node.js – Running CLI scripts from create-react-app

In a new application created with create-react-application, How can I run a command line script? The following fails:

$ npx create-react-application foo
[snip]
$ cd foo /
$ echo "import {App} from & # 39; ./ src / App.js & # 39 ;;" > test.js
$ node test.js
/private/tmp/foo/test.js:1
import {App} from & # 39; ./ src / App.js & # 39 ;;
^

Syntax error: unexpected symbol {
in Module._compile (internal / modules / cjs / loader.js: 718: 23)
in Object.Module._extensions..js (internal / modules / cjs / loader.js: 785: 10)
in Module.load (internal / modules / cjs / loader.js: 641: 32)
in Function.Module._load (internal / modules / cjs / loader.js: 556: 12)
in Function.Module.runMain (internal / modules / cjs / loader.js: 837: 10)
in internal / main / run_main_module.js: 17: 11