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

get-package-name

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-package-name - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

10

index.js

@@ -14,8 +14,10 @@ const path = require('path')

if (index > -1) {
const name = segments[index + 1]
const name = segments[index + 1] || ''
const scopedName = segments[index + 2] || ''
if (name[0] === '@') {
const scopedName = segments[index + 2]
return `${name}/${scopedName}`
} else {
return scopedName ? `${name}/${scopedName}` : undefined
}
if (name) {
return name

@@ -22,0 +24,0 @@ }

7

package.json
{
"name": "get-package-name",
"version": "2.1.0",
"version": "2.2.0",
"description": "Get the name of a dependency from a module file path.",

@@ -9,4 +9,5 @@ "main": "index.js",

"test:spec": "jasmine tests/spec.js",
"test:prettier": "prettier --config .prettierrc.json --list-different **/*.js",
"test": "npm run test:prettier && npm run test:spec"
"test:prettier": "prettier --config .prettierrc.json --check *.js **/*.js",
"test": "npm run test:prettier && npm run test:spec",
"format": "prettier --config .prettierrc.json --write *.js **/*.js"
},

@@ -13,0 +14,0 @@ "repository": {

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