UNPKG

1.57 kBMarkdownView Raw
1# Create JS App
2
3Create full stack javascript apps with no build configuration and one dependency.
4
5## Installation
6
7```sh
8npm install -g create-js-app
9
10create-js-app my-app
11cd my-app/
12npm start
13```
14
15Then open [http://localhost:3000](http://localhost:3000) to see your app.
16
17## Development
18
19To start development run following command in project root directory.
20
21```sh
22npm start
23```
24
25## Production
26
27To create a minified build run following command in project root directory.
28
29```sh
30npm run build
31```
32
33## Configuration
34
35```js
36// .app.js file in project directory
37
38module.exports = {
39 // default is create-js-app-scripts/scripts/config/eslint/default.js
40 eslint: 'create-js-app-scripts/scripts/config/eslint/airbnb.js',
41
42 // tasks you want to run during development
43 // it will terminate them when you terminate development script
44 tasks: [
45 (eventEmitter) => {
46 // do something, maybe watch files using chokidar, anything
47 eventEmitter.emit('task-log', 'some info');
48 eventEmitter.emit('task-log-error', 'some info');
49 eventEmitter.emit('task-log-info', 'some info');
50 eventEmitter.emit('task-log-success', 'some info');
51 eventEmitter.emit('task-log-warning', 'some info');
52
53 return {
54 /**
55 * This is used to terminate task when command receives SIGTERM
56 * @returns {Promise}
57 */
58 terminate() {
59 return Promise.resolve();
60 }
61 }
62 }
63 ]
64};
65```