ice-npm-utils
v3.0.3
Published
npm utils for ice
Downloads
1,919
Keywords
Readme
ice-npm-utils
some utils for ice.
Installation
npm install ice-npm-utils --save-dev
Basic Usage
const { getNpmLatestSemverVersion } = require('ice-npm-utils');
API
getNpmRegistry(npmName)
Default return https://registry.npm.taobao.org
getUnpkgHost(npmName)
Default return https://unpkg.com
getNpmLatestSemverVersion(npmName, baseVersion)
Return Promise.resolve(version)
getLatestVersion(npmName)
Return Promise.resolve(version)
getVersions(npmName)
Return Promise.resolve(versions)
getSatisfiesVersions(npmName, semverRange)
Return Promise.resolve(versions)
getNpmInfo(npmName)
Return Promise.resolve(response.data)
getNpmClient(npmName)
Default return npm
checkAliInternal()
Return Promise.resolve(isInternal)
getNpmTarball(name, version)
Return Promise.resolve(tarball)
getAndExtractTarball(destDir, tarball, progressFunc: () => {})
Return Promise.resolve(allFiles: string[])
Custom
Custom Npm Registry
process.env.REGISTRY=https://registry.npmjs.org
Custom Unpkg Host
process.env.UNPKG=https://unpkg.com
Custom Npm Client
process.env.NPM_CLIENT=cnpm