Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

validate-npm-package-name

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validate-npm-package-name - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

4

index.js

@@ -61,4 +61,4 @@ var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");

// really-long-package-names-------------------------------such--length-----many---wow
if (name.length > 50) {
warnings.push("name can no longer contain more than 50 characters")
if (name.length > 128) {
warnings.push("name can no longer contain more than 128 characters")
}

@@ -65,0 +65,0 @@

{
"name": "validate-npm-package-name",
"version": "2.0.1",
"version": "2.1.0",
"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",

@@ -61,3 +61,3 @@ # validate-npm-package-name

```js
validate("cRaZY-paCkAgE-with-mixed-case-and-more-than-fifty-characters")
validate("cRaZY-paCkAgE-with-mixed-case-and-more-than-128-characters----------------------------------------------------------------------")
```

@@ -73,3 +73,3 @@

"name can no longer contain capital letters",
"name can no longer contain more than 50 characters"
"name can no longer contain more than 128 characters"
]

@@ -76,0 +76,0 @@ }

@@ -83,6 +83,6 @@ var validate = require("..")

t.deepEqual(validate("1234567890123456789012345678901234567890-more-than-fifty"), {
t.deepEqual(validate("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"), {
validForNewPackages: false,
validForOldPackages: true,
warnings: ["name can no longer contain more than 50 characters"]
warnings: ["name can no longer contain more than 128 characters"]
})

@@ -89,0 +89,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc