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
2
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.1.0 to 2.2.0

5

index.js

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

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

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

2

package.json
{
"name": "validate-npm-package-name",
"version": "2.1.0",
"version": "2.2.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-128-characters----------------------------------------------------------------------")
validate("cRaZY-paCkAgE-with-mixed-case-and-more-than-214-characters-----------------------------------------------------------------------------------------------------------------------------------------------------------")
```

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

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

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

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

t.deepEqual(validate("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"), {
t.deepEqual(validate("ifyouwanttogetthesumoftwonumberswherethosetwonumbersarechosenbyfindingthelargestoftwooutofthreenumbersandsquaringthemwhichismultiplyingthembyitselfthenyoushouldinputthreenumbersintothisfunctionanditwilldothatforyou-"), {
validForNewPackages: false,
validForOldPackages: true,
warnings: ["name can no longer contain more than 128 characters"]
warnings: ["name can no longer contain more than 214 characters"]
})
t.deepEqual(validate("ifyouwanttogetthesumoftwonumberswherethosetwonumbersarechosenbyfindingthelargestoftwooutofthreenumbersandsquaringthemwhichismultiplyingthembyitselfthenyoushouldinputthreenumbersintothisfunctionanditwilldothatforyou"), {
validForNewPackages: true,
validForOldPackages: true
})
// Legacy Mixed-Case

@@ -91,0 +96,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