@voidvoxel/package-json

1.0.3 • Public • Published

@voidvoxel/package-json

Known Vulnerabilities

Programmatically access and modify package.json files.

Installation

npm i @voidvoxel/package-json

Usage

// Import the package.
import PackageJSON from "@voidvoxel/package-json";
/* OR */
const PackageJSON = require("@voidvoxel/package-json");

// Read a `package.json` file.
const packageJSONPath = "./package.json";
const packageJSON = PackageJSON.readFileSync(packageJSONPath);

// Change some values.
packageJSON.name = "example-package";
packageJSON.version = "4.2.0";

// Add a dependency to the package.
packageName.addDependency("moment");

// Save our changes to the file.
PackageJSON.writeFileSync(
    packageJSONPath,
    packageJSON
);

Package Sidebar

Install

npm i @voidvoxel/package-json

Weekly Downloads

0

Version

1.0.3

License

MPL-2.0

Unpacked Size

28.1 kB

Total Files

6

Last publish

Collaborators

  • voidvoxel