-
Notifications
You must be signed in to change notification settings - Fork 0
validate
Subhajit Sahu edited this page Apr 24, 2021
·
4 revisions
Validates Node.js package field.
enpm validate <field> <value> [options]
# field: package field to validate
## name, version, license, email, username
# value: value of field
# -> 1 if valid for new packages
# -> 0 if valid for old packages
# -> -1 otherwise (error)
# Options:
# --help: view this help
# --silent: enable showing only -1 on error (0)
# Environment variables:
$NPM_SILENT # enable showing only -1 on error (0)
$ enpm validate name boolean
# is name "boolean" is valid?
## 1
$ enpm validate version 0.1.1.exe
# is version "0.1.1.exe" valid?
## error: invalid semver format
$ enpm validate license hyd-license --silent
# is license "hyd-license" valid?
## -1