Socket
Socket
Sign inDemoInstall

validate-npm-package-name

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "validate-npm-package-name",
"version": "1.1.0",
"version": "1.1.1",
"description": "Give me a string and I'll tell you if it's a valid npm package name",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,3 +20,2 @@ # validate-npm-package-name

validate("example.com") // => {valid: true}
validate("CAPITALS") // => {valid: true}
validate("under_score") // => {valid: true}

@@ -31,3 +30,10 @@ validate("123numeric") // => {valid: true}

validate("_flodash") // => {valid: false, errors:["name cannot start with an underscore"]}
validate("CAPITALS") // => {valid: false, errors:["name must be lowercase"]}
// Nowadays, package names have to be lowercase
// To validate older packages, do this:
validate("CAPITALS",
{allowMixedCase: true}) // => {valid: true}
```

@@ -34,0 +40,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc