1 | # Create JS App
|
2 |
|
3 | Create full stack javascript apps with no build configuration and one dependency.
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```sh
|
8 | npm install -g create-js-app
|
9 |
|
10 | create-js-app my-app
|
11 | cd my-app/
|
12 | npm start
|
13 | ```
|
14 |
|
15 | Then open [http://localhost:3000](http://localhost:3000) to see your app.
|
16 |
|
17 | ## Development
|
18 |
|
19 | To start development run following command in project root directory.
|
20 |
|
21 | ```sh
|
22 | npm start
|
23 | ```
|
24 |
|
25 | ## Production
|
26 |
|
27 | To create a minified build run following command in project root directory.
|
28 |
|
29 | ```sh
|
30 | npm run build
|
31 | ```
|
32 |
|
33 | ## Configuration
|
34 |
|
35 | ```js
|
36 | // .app.js file in project directory
|
37 |
|
38 | module.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 | ```
|