All Projects → diegohaz → Nod

diegohaz / Nod

Licence: mit
Node.js module generator/boilerplate with Babel, Jest, Flow, Documentation and more

Programming Languages

javascript
184084 projects - #8 most used programming language
flow
126 projects
flowtype
47 projects

Projects that are alternatives of or similar to Nod

Pwa
An opinionated progressive web app boilerplate
Stars: ✭ 353 (-0.56%)
Mutual labels:  babel, boilerplate, jest
React Native Navigation Redux Starter Kit
React Native Navigation(v2) Starter Kit with Redux, Saga, ESLint, Babel, Jest and Facebook SDK 😎
Stars: ✭ 271 (-23.66%)
Mutual labels:  babel, boilerplate, jest
Express Babel
Express starter kit with ES2017+ support, testing, linting, and code coverage
Stars: ✭ 621 (+74.93%)
Mutual labels:  babel, boilerplate, jest
Yarn Package Boilerplate
An Yarn package with babel, jest, flow, prettier and more
Stars: ✭ 10 (-97.18%)
Mutual labels:  babel, boilerplate, jest
React Bolt
⚡ The most simple & robust boilerplate for your React projects.
Stars: ✭ 298 (-16.06%)
Mutual labels:  babel, boilerplate, jest
React
Extremely simple boilerplate, easiest you can find, for React application including all the necessary tools: Flow | React 16 | redux | babel 6 | webpack 3 | css-modules | jest | enzyme | express + optional: sass/scss
Stars: ✭ 244 (-31.27%)
Mutual labels:  babel, boilerplate, jest
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-90.99%)
Mutual labels:  babel, boilerplate, jest
Rest
REST API generator with Node.js, Express and Mongoose
Stars: ✭ 1,663 (+368.45%)
Mutual labels:  boilerplate, yeoman-generator, jest
React Pages Boilerplate
Deliver react + react-router application to gh-pages
Stars: ✭ 134 (-62.25%)
Mutual labels:  babel, boilerplate, jest
React Boilerplate
This project is deprecated. Please use CRA instead.
Stars: ✭ 88 (-75.21%)
Mutual labels:  babel, boilerplate, jest
React Boilerplate
Production-ready boilerplate for building universal web apps with React and Redux
Stars: ✭ 53 (-85.07%)
Mutual labels:  babel, boilerplate, jest
Js Stack Boilerplate
Final boilerplate code of the JavaScript Stack from Scratch tutorial –
Stars: ✭ 145 (-59.15%)
Mutual labels:  babel, boilerplate, jest
Iceberg
Front-End Boilerplate built with React + Babel + Webpack + SASS
Stars: ✭ 144 (-59.44%)
Mutual labels:  babel, boilerplate, jest
Electron React Boilerplate
A Foundation for Scalable Cross-Platform Apps
Stars: ✭ 18,727 (+5175.21%)
Mutual labels:  babel, boilerplate, jest
generator-node
🔧 Yeoman generator for Node projects.
Stars: ✭ 16 (-95.49%)
Mutual labels:  jest, yeoman-generator
Express Mongoose Es6 Rest Api
💥 A boilerplate application for building RESTful APIs Microservice in Node.js using express and mongoose in ES6 with code coverage and JsonWebToken Authentication
Stars: ✭ 2,811 (+691.83%)
Mutual labels:  babel, boilerplate
react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (-94.65%)
Mutual labels:  babel, jest
medly-components
🧩 Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.
Stars: ✭ 66 (-81.41%)
Mutual labels:  babel, jest
quantum-blox
Quantum blox - modular UI boilerplate in react
Stars: ✭ 12 (-96.62%)
Mutual labels:  modules, jest
Babel Plugin Tester
Utilities for testing babel plugins
Stars: ✭ 228 (-35.77%)
Mutual labels:  babel, jest

nod

NPM version Build Status Coverage Status

NodeJS module generator/boilerplate.

Features

  • Babel - Write next generation JavaScript today.
  • Jest - JavaScript testing framework used by Facebook.
  • ESLint - Make sure you are writing a quality code.
  • Prettier - Enforces a consistent style by parsing your code and re-printing it.
  • Flow - A static type checker for JavaScript used heavily within Facebook.
  • Travis CI - Automate tests and linting for every push or pull request.
  • Documentation - A documentation system so good, you'll actually write documentation.
  • Standard Version - Automate versioning and CHANGELOG generation.

Install

The easiest way to use nod is through the Yeoman Generator.

$ npm install -g yo generator-nod
$ yo nod

If you don't want to use the generator, you can also download or git clone this repo

$ git clone https://github.com/diegohaz/nod my-module
$ cd my-module
$ rm -rf .git
$ npm install # or yarn

Just make sure to edit package.json, README.md and LICENSE files accordingly with your module's info.

Commands

$ npm test # run tests with Jest
$ npm run coverage # run tests with coverage and open it on browser
$ npm run lint # lint code
$ npm run docs # generate docs
$ npm run build # generate docs and transpile code

Publish

$ npm release
$ npm publish

It'll automatically run test, lint, docs, build, generate CHANGELOG.md, and push commits and tags to the remote repository.

Removing stuff

Flow
  1. Remove .flowconfig file.

  2. Remove flow from package.json:

      "scripts": {
    -   "flow": "flow check",
    -   "flowbuild": "flow-copy-source src dist",
    -   "prebuild": "npm run docs && npm run clean && npm run flowbuild",
    +   "prebuild": "npm run docs && npm run clean",
      },
      "devDependencies": {
    -   "@babel/preset-flow": "^7.0.0",
    -   "eslint-plugin-flowtype": "^2.50.0",
    -   "eslint-plugin-flowtype-errors": "^3.5.1",
    -   "flow-bin": "^0.81.0",
    -   "flow-copy-source": "^2.0.2",
      }
    
  3. Remove flow from .babelrc:

      "presets": [
    -   "@babel/preset-flow"
      ]
    
  4. Remove flow from .eslintrc:

      "extends": [
    -   "plugin:flowtype/recommended",
    -   "prettier/flowtype"
      ],
      "plugins": [
    -   "flowtype",
    -   "flowtype-errors"
      ],
      "rules": {
    -   "flowtype-errors/show-errors": "error"
      }
    
  5. Run yarn.

Documentation
  1. Remove documentation from package.json:

      "scripts": {
    -   "docs": "documentation readme src --section=API",
    -   "postdocs": "git add README.md",
    -   "prebuild": "npm run docs && npm run clean",
    +   "prebuild": "npm run clean",
      },
      "devDependencies": {
    -   "documentation": "^8.0.0",
      }
    
  2. Run yarn.

Adding stuff

TypeScript
  1. Install dependencies:

    yarn add -D @babel/preset-typescript @types/jest @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
    
  2. Update package.json:

    + "types": "dist/ts/src",
      "scripts": {
    +   "type-check": "tsc --noEmit",
    -   "lint": "eslint .",
    +   "lint": "eslint . --ext js,ts,tsx",
    -   "build": "babel src -d dist",
    +   "build": "tsc --emitDeclarationOnly && babel src -d dist -x .js,.ts,.tsx",
      },
      "lint-staged": {
    -   "*.js": [
    +   "*.{js,ts,tsx}": [
    -     "eslint --fix",
    +     "eslint --fix --ext js,ts,tsx",
          "git add"
        ]
      }
    
  3. Create tsconfig.json

    {
      "compilerOptions": {
        "outDir": "dist/ts",
        "target": "esnext",
        "module": "esnext",
        "moduleResolution": "node",
        "jsx": "react",
        "strict": true,
        "declaration": true,
        "noFallthroughCasesInSwitch": true,
        "noImplicitReturns": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "stripInternal": true
      }
    }
    
  4. Update .babelrc:

      "presets": [
    +   "@babel/preset-typescript"
      ]
    
  5. Update .eslintrc with these settings:

      "settings": {
        "import/resolver": {
          "node": {
            "extensions": [".js", ".jsx", ".ts", ".tsx"]
          }
        }
      },
      "overrides": [
        {
          "files": ["**/*.ts", "**/*.tsx"],
          "parser": "@typescript-eslint/parser",
          "parserOptions": {
            "project": "./tsconfig.json"
          },
          "plugins": [
            "@typescript-eslint"
          ],
          "rules": {
            "no-undef": "off",
            "no-unused-vars": "off",
            "no-restricted-globals": "off"
          }
        }
      ]
    

API

Table of Contents

sayHello

This function says hello.

Parameters

  • name string Some name to say hello for. (optional, default "Haz")

Returns string The hello.

License

MIT © Diego Haz

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].