npm.io
0.0.5 • Published 6 years agoCLI

create-defaults

Licence
MIT
Version
0.0.5
Deps
0
Size
13 kB
Vulns
0
Weekly
0

create-defaults

A simple generator for creating default files in a directory

Install

This package should be installed globally or linked using npm link

npm install create-defaults --global

Usage

Create/update all files listed in .defaults
$ defaults
Create/update specified file(s)
$ defaults file-name1 file-name2

specified files that aren't in .defaults will be ignored

Configuration File

Configuration settings are determined by the closest .defaults file to the current directory

{
  "writeFiles": [
    {
      "name": "",
      "value": [],
      "update" true | false
    },
    ...
  ]
}

example:

{
  "writeFiles": [
    {
      "name": ".gitignore",
      "value": ["node_modules", ".vscode"],
      "update": true
    },
    {
      "name": "src/components/index.js"
    }
  ]
}
  • update: true will update and override .gitignore with default values (should be used with caution)

  • src/components/index.js will recursively create src/ and components/ (if it doesn't already exist) and then create index.js

Keywords