init-package-json

A node module to get your node module started

ISC 78 个版本
安装
npm install init-package-json
yarn add init-package-json
pnpm add init-package-json
bun add init-package-json
README

init-package-json

A node module to get your node module started.

Usage

const init = require('init-package-json')
const path = require('path')

// a path to a promzard module.  In the event that this file is
// not found, one will be provided for you.
const initFile = path.resolve(process.env.HOME, '.npm-init')

// the dir where we're doin stuff.
const dir = process.cwd()

// extra stuff that gets put into the PromZard module's context.
// In npm, this is the resolved config object.  Exposed as 'config'
// Optional.
const configData = { some: 'extra stuff' }

// Any existing stuff from the package.json file is also exposed in the
// PromZard module as the `package` object.  There will also be three
// vars for:
// * `filename` path to the package.json file
// * `basename` the tip of the package dir
// * `dirname` the parent of the package dir

const data = await init(dir, initFile, configData)
// the data's already been written to {dir}/package.json
// now you can do stuff with it

See PromZard for details about what can go in the config file.

版本列表
9.0.0 2026-05-22
8.2.5 2026-02-19
8.2.4 2025-11-21
8.2.3 2025-11-17
8.2.2 2025-08-29
8.2.1 2025-05-14
8.2.0 2025-05-05
8.1.1 2025-04-23
8.1.0 2025-04-23
8.0.0 2024-12-02
7.0.2 2024-12-02
7.0.1 2024-10-02
7.0.0 2024-09-26
6.0.3 2024-05-04
6.0.2 2024-03-01
6.0.1 2024-02-29
6.0.0 2023-08-15
5.0.0 2023-02-06
4.0.1 2022-10-18
4.0.0 2022-10-14
3.0.2 2022-03-29
3.0.1 2022-03-15
3.0.0 2022-02-17
2.0.5 2021-09-09
2.0.4 2021-08-18
2.0.3 2021-04-17
2.0.2 2021-02-04
2.0.1 2020-10-16
2.0.0 2020-10-10
1.10.3 2018-03-07
1.10.2 2018-03-07
1.10.1 2017-04-22
1.10.0 2017-04-20
1.9.6 2017-04-14
1.9.5 2017-03-07
1.9.4 2016-05-18
1.9.3 2016-01-12
1.9.2 2016-01-12
1.9.1 2015-08-27
1.9.0 2015-08-27
1.8.0 2015-08-13
1.7.1 2015-07-16
1.7.0 2015-06-19
1.6.1 2015-06-19
1.6.0 2015-05-21
1.5.0 2015-05-06
1.4.2 2015-04-23
1.4.1 2015-04-17
1.4.0 2015-04-07
1.3.2 2015-04-03
1.3.1 2015-04-03
1.3.0 2015-02-27
1.2.0 2015-01-20
1.1.3 2014-12-12
1.1.2 2014-11-05
1.1.1 2014-10-23
1.1.0 2014-09-19
1.0.1 2014-09-11
1.0.0 2014-07-30
0.1.2 2014-07-23
0.1.1 2014-07-11
0.1.0 2014-06-06
0.0.17 2014-05-16
0.0.16 2014-04-17
0.0.15 2014-02-18
0.0.14 2013-11-26
0.0.13 2013-11-19
0.0.11 2013-08-02
0.0.10 2013-06-20
0.0.9 2013-06-17
0.0.8 2013-04-29
0.0.7 2012-11-07
0.0.6 2012-10-02
0.0.5 2012-07-24
0.0.4 2012-06-18
0.0.3 2012-06-18
0.0.2 2012-06-17
0.0.1 2012-06-17