write-pkg

WebJar for write-pkg

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

write-pkg
Последняя версия

Последняя версия

3.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

write-pkg
WebJar for write-pkg
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/write-pkg

Скачать write-pkg

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/write-pkg/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>write-pkg</artifactId>
    <version>3.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/write-pkg/
implementation 'org.webjars.npm:write-pkg:3.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/write-pkg/
implementation ("org.webjars.npm:write-pkg:3.2.0")
'org.webjars.npm:write-pkg:jar:3.2.0'
<dependency org="org.webjars.npm" name="write-pkg" rev="3.2.0">
  <artifact name="write-pkg" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='write-pkg', version='3.2.0')
)
libraryDependencies += "org.webjars.npm" % "write-pkg" % "3.2.0"
[org.webjars.npm/write-pkg "3.2.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : sort-keys jar [2.0.0,3)
org.webjars.npm : write-json-file jar [2.2.0,3)

Модули Проекта

Данный проект не имеет модулей.

write-pkg

Write a package.json file

Writes atomically and creates directories for you as needed. Sorts dependencies when writing. Preserves the indentation if the file already exists.

Install

$ npm install write-pkg

Usage

const path = require('path');
const writePackage = require('write-pkg');

(async () => {
	await writePackage({foo: true});
	console.log('done');

	await writePackage(__dirname, {foo: true});
	console.log('done');

	await writePackage(path.join('unicorn', 'package.json'), {foo: true});
	console.log('done');
})();

API

writePackage(path?, data, options?)

Returns a Promise.

writePackage.sync(path?, data, options?)

path

Type: string
Default: process.cwd()

Path to where the package.json file should be written or its directory.

options

Type: object

normalize

Type: boolean
Default: true

Remove empty dependencies, devDependencies, optionalDependencies and peerDependencies objects.

write-pkg for enterprise

Available as part of the Tidelift Subscription.

The maintainers of write-pkg and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Related

Версии библиотеки

Версия
3.2.0