How to use init-package-json - 3 common examples

To help you get started, we’ve selected a few init-package-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexanderGugel / ied / src / init_cmd.js View on Github external
export default function initCmd (cwd) {
	const initFile = path.resolve(config.home, '.ied-init')

	init(cwd, initFile, (err) => {
		if (err) {
			if (err.message === 'canceled') {
				console.log('init canceled!')
				return
			}
			throw err
		}
	})
}
github davidhealey / waistline / node_modules / npm / lib / init.js View on Github external
function init (args, cb) {
  var dir = process.cwd()
  log.pause()
  npm.spinner.stop()
  var initFile = npm.config.get("init-module")
  if (!initJson.yes(npm.config)) {
    console.log(
      ["This utility will walk you through creating a package.json file."
      ,"It only covers the most common items, and tries to guess sensible defaults."
      ,""
      ,"See `npm help json` for definitive documentation on these fields"
      ,"and exactly what they do."
      ,""
      ,"Use `npm install  --save` afterwards to install a package and"
      ,"save it as a dependency in the package.json file."
      ,""
      ,"Press ^C at any time to quit."
      ].join("\n"))
  }
  initJson(dir, initFile, npm.config, function (er, data) {
    log.resume()
    log.silly("package data", data)
github graalvm / graaljs / deps / npm / lib / init.js View on Github external
)
        err.code = 'EUNSUPPORTED'
        throw err
      }
    }
    var npxArgs = [process.argv0, '[fake arg]', '--always-spawn', packageName, ...process.argv.slice(4)]
    var parsed = npx.parseArgs(npxArgs, NPM_PATH)

    return npx(parsed)
      .then(() => cb())
      .catch(cb)
  }
  var dir = process.cwd()
  log.pause()
  var initFile = npm.config.get('init-module')
  if (!initJson.yes(npm.config)) {
    output([
      'This utility will walk you through creating a package.json file.',
      'It only covers the most common items, and tries to guess sensible defaults.',
      '',
      'See `npm help json` for definitive documentation on these fields',
      'and exactly what they do.',
      '',
      'Use `npm install ` afterwards to install a package and',
      'save it as a dependency in the package.json file.',
      '',
      'Press ^C at any time to quit.'
    ].join('\n'))
  }
  initJson(dir, initFile, npm.config, noProgressTillDone(function (er, data) {
    log.resume()
    log.silly('package data', data)

init-package-json

A node module to get your node module started

ISC
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis

Popular init-package-json functions