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

@pnpm/pkgid-to-filename

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/pkgid-to-filename - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0-0

6

lib/index.js

@@ -6,4 +6,6 @@ "use strict";

function pkgIdToFilename(pkgId, prefix) {
if (pkgId.indexOf('file:') !== 0)
return pkgId;
if (pkgId.indexOf('file:') !== 0) {
const index = pkgId.lastIndexOf('/');
return `${pkgId.substr(0, index)}@${pkgId.substr(index + 1)}`;
}
const absolutePath = path.join(prefix, pkgId.slice(5));

@@ -10,0 +12,0 @@ return `local/${encodeURIComponent(normalize(absolutePath))}`;

{
"name": "@pnpm/pkgid-to-filename",
"version": "2.0.0",
"description": "Converts a package ID to a valid file name",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
"lib"
],
"engines": {
"node": ">=6"
},
"scripts": {
"lint": "tslint -c tslint.json --project .",
"tsc": "rimraf lib && tsc",
"test": "npm run lint && preview && ts-node test && mos t",
"md": "mos",
"prepublishOnly": "npm run tsc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pnpm/pkgid-to-filename.git"
},
"keywords": [
"pnpm",
"integrity",
"package",
"store"
],
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/pnpm/pkgid-to-filename/issues"
},
"homepage": "https://github.com/pnpm/pkgid-to-filename#readme",
"dependencies": {
"normalize-path": "^3.0.0"
},
"devDependencies": {
"@types/node": "^10.9.4",
"@types/tape": "^4.2.31",
"mos": "^2.0.0-alpha.3",
"mos-plugin-readme": "^1.0.4",
"package-preview": "^1.0.1",
"rimraf": "^2.6.2",
"tape": "^4.8.0",
"ts-node": "^7.0.0",
"tslint": "^5.8.0",
"typescript": "^3.0.0"
},
"mos": {
"plugins": [
"readme"
],
"installation": {
"useShortAlias": true
}
}
"name": "@pnpm/pkgid-to-filename",
"version": "3.0.0-0",
"description": "Converts a package ID to a valid file name",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
"lib"
],
"engines": {
"node": ">=10.13"
},
"scripts": {
"lint": "tslint -c tslint.json --project .",
"tsc": "rimraf lib && tsc",
"test": "npm run lint && preview && ts-node test",
"prepublishOnly": "npm run tsc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pnpm/pkgid-to-filename.git"
},
"keywords": [
"pnpm",
"integrity",
"package",
"store"
],
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/pnpm/pkgid-to-filename/issues"
},
"homepage": "https://github.com/pnpm/pkgid-to-filename#readme",
"dependencies": {
"normalize-path": "^3.0.0"
},
"devDependencies": {
"@types/node": "^13.13.4",
"@types/tape": "^4.2.31",
"package-preview": "^3.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"ts-node": "^8.10.1",
"tslint": "^6.1.2",
"typescript": "^3.0.0"
}
}

@@ -9,8 +9,6 @@ # @pnpm/pkgid-to-filename

Most package IDs are already unique and valid filenames, so only the package IDs of local dependencies are converted.
## Installation
```sh
npm i -S @pnpm/pkgid-to-filename
<pnpm|npm|yarn> add @pnpm/pkgid-to-filename
```

@@ -32,3 +30,3 @@

pkgIdToFilename('registry.npmjs.org/foo/1.0.0')
//> registry.npmjs.org/foo/1.0.0
//> registry.npmjs.org/foo@1.0.0
```

@@ -35,0 +33,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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