@jokeyrhyme/node-init

    4.0.0 • Public • Published

    jokeyrhyme / node-init npm Travis CI Status

    impose my will upon a new or existing Node.js project

    Usage

    npm install -g @jokeyrhyme/node-init
     
    # use to start a fresh new project from scratch: 
    node-init my-project
     
    # which is the equivalent of running: 
    mkdir my-project; cd my-project; node-init
     
    # without a project name, assume current working directory: 
    node-init
     
    # to find more details about usage 
    node-init --help

    Options

    --scope [scope]        set npm @scope prefix
    --check-git-status     stop work if un-versioned changes
    --no-check-git-status  do work even if un-versioned changes
    

    What does this do?

    Version Control

    • runs git init to start a git repository, if none is found

    • ensures there's a .gitignore file containing "node_modules"

    NPM good-practices

    • runs npm init -y to start a package.json or to restore important missing fields to an existing package.json

    • ensures "name" in package.json includes desired scope (if any)

    • ensures "engines" is set in package.json, defaults to major versions of current npm and node

    • ensures all versions in "devDependencies" in package.json start with "^"

    • adds an NPM version badge to README.md if none is found, and the package is not marked as "private"

    • sets default { publishConfig: { access: 'public' } } in package.json if there is a scope

    • use sort-package-json to keep package.json tidy

    • package "main" refers to a file that exists (created for you, if not)

    • use nsp to check for vulnerable dependencies

    Code Quality

    • installs and configures prettier and npm run prettier

    • installs and configures ESLint, with eslint-plugin-node

    • install and configure jest if other test frameworks are absent and npm test is not configured

    • adds an npm run eslint script for ESLint

    • installs and configures FlowType and npm run flow

    • uninstalls FlowType when not used

    • add npm run ava if using ava

    • add npm run jest if using jest

    • add npm run mocha if using mocha

    • add npm run nyc if using nyc

    Continuous Integration

    • adds a Travis CI badge to README.md if none is found (GitHub-only)

    • ensures .travis.yml has good defaults at least (GitHub-only)

    • adds an AppVeyor badge to README.md if none is found (GitHub-only or Bitbucket-only)

    • ensures appveyor.yml has good defaults at least (GitHub-only or Bitbucket-only)

    IDE / Code Editor settings

    Other Opinionated Stuff

    • for simplicity, text files should use UNIX line-endings

    • install a project-local copy of npx, which is very useful for executing other CLI tools

    Keywords

    none

    Install

    npm i @jokeyrhyme/node-init

    DownloadsWeekly Downloads

    6

    Version

    4.0.0

    License

    BSD-2-Clause

    Unpacked Size

    72.7 kB

    Total Files

    40

    Last publish

    Collaborators

    • jokeyrhyme