javascript 节点项目备忘单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 节点项目备忘单相关的知识,希望对你有一定的参考价值。

1. Run `yarn init`
1. Create **src/app.js**
1. Updated **main** in **package.json**
1. Run `yarn add nodemon -D`
1. Run `yarn add babel-cli babel-preset-env -D`
1. Create **.babelrc**
1. Setup **scripts** in **package.json**
1. Run `yarn add eslint babel-eslint prettier eslint-plugin-prettier eslint-config-prettier -D`
1. Create **.eslint.js** file
1. Create **.prettierrc.js** file
{
  "presets": ["babel-preset-env"]
}
If you want to use .env files

1. Run `yarn add dotenv`
1. Create **.env** file
1. Import **dotenv** in files that need it

```
import dotenv from 'dotenv'

dotenv.config()
```
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ['plugin:prettier/recommended'],
  rules: {
    'no-console': ['error', { allow: ['error'] }],
    'prettier/prettier': 'error',
    semi: ['error', 'never'],
    quotes: ['error', 'single']
  },
  parser: 'babel-eslint',
  parserOptions: {
    parser: 'babel-eslint'
  }
}
module.exports = {
  useTabs: false,
  singleQuote: true,
  semi: false
}

以上是关于javascript 节点项目备忘单的主要内容,如果未能解决你的问题,请参考以下文章

javascript JavaScript DocBlock备忘单

markdown 节点单元测试备忘单:Mocha,Chai和Sinon

text Javascript OO备忘单

javascript Firebase功能备忘单

javascript socket.io的快速备忘单

javascript JSDOC备忘单