# init-package-json

> A node module to get your node module started

Latest version **9.0.0** (published 2026-05-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install init-package-json
pnpm add init-package-json
yarn add init-package-json
bun add init-package-json
```

## Health

**Score 63/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 9.0.0 |
| Published | 2026-05-22 |
| First published | 2012-06-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/init-package-json) |
| Module format | CommonJS |
| Node | ^22.22.2 \|\| ^24.15.0 \|\| >=26.0.0 |
| Dependencies | 6 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 343 |
| Author | GitHub Inc. |
| Maintainers | saquibkhan, npm-cli-ops, reggi, owlstronaut |
| Keywords | init, package.json, package, helper, wizard, wizerd, prompt, start |

## Links

- npm: https://www.npmjs.com/package/init-package-json
- Repository: https://github.com/npm/init-package-json
- Homepage: https://github.com/npm/init-package-json#readme
- Issues: https://github.com/npm/init-package-json/issues
- npm.io page: https://npm.io/package/init-package-json

## Dependencies (6)

- [read](https://npm.io/package/read.md) ^6.0.0
- [semver](https://npm.io/package/semver.md) ^7.7.2
- [promzard](https://npm.io/package/promzard.md) ^4.0.0
- [npm-package-arg](https://npm.io/package/npm-package-arg.md) ^14.0.0
- [@npmcli/package-json](https://npm.io/package/@npmcli/package-json.md) ^8.0.0
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) ^8.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 9.0.0 (latest) — 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
- … 63 more at https://npm.io/package/init-package-json/versions

## README

# init-package-json

A node module to get your node module started.

## Usage

```javascript
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](https://github.com/npm/promzard) for details about
what can go in the config file.

---
_Source: https://npm.io/package/init-package-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
