@liquid-labs/npm-toolkit

1.0.0-alpha.17 • Public • Published

npm-toolkit

coverage: 91% Unit tests

A programmatic wrapper around key npm functions and package data manipulation utilities.

Installation

npm i @liquid-labs/npm-toolkit

Usage

import * as fsPath from 'node:path'

import * as npm from '@liquid-labs/npm-toolkit'

const pkgDir = fsPath.join('path', 'to', 'package')
const pkgJSON = await npm.getPackageJSON(( pkgDir ))
const { name, org, basename, version } = npm.getPackageOrgBasenameAndVersion({ pkgJSON })
// alt forms:
// const { name, org, basename, version } = await getPackageOrgBasenameAndVersion({ pkgDir })
// const { name, org, basename, version } = await getPackageOrgBasenameAndVersion('@acme/foo@^1.0')

await nmp.update({ global: true })
await npm.install({ global: true, packages: ['npm-check@latest' ]})

Readme

Keywords

Package Sidebar

Install

npm i @liquid-labs/npm-toolkit

Weekly Downloads

1

Version

1.0.0-alpha.17

License

Apache-2.0

Unpacked Size

223 kB

Total Files

29

Last publish

Collaborators

  • zanerock