🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@pnpm/read-importer-manifest

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/read-importer-manifest - npm Package Compare versions

Comparing version

to
1.0.2

13

lib/index.js

@@ -138,4 +138,13 @@ "use strict";

exports.readExactImporterManifest = readExactImporterManifest;
function readPackageYaml(filePath) {
return read_yaml_file_1.default(filePath);
async function readPackageYaml(filePath) {
try {
return await read_yaml_file_1.default(filePath);
}
catch (err) {
if (err.name !== 'YAMLException')
throw err;
err.message += `\nin ${filePath}`;
err['code'] = 'ERR_PNPM_YAML_PARSE';
throw err;
}
}

@@ -142,0 +151,0 @@ function createManifestWriter(opts) {

30

lib/readFile.js

@@ -5,2 +5,3 @@ "use strict";

const JSON5 = require("json5");
const parseJson = require("parse-json");
const stripBom = require("strip-bom");

@@ -11,6 +12,13 @@ const util_1 = require("util");

const text = await readFileWithoutBom(filePath);
return {
data: JSON5.parse(text),
text,
};
try {
return {
data: JSON5.parse(text),
text,
};
}
catch (err) {
err.message += ` in ${filePath}`;
err['code'] = 'ERR_PNPM_JSON5_PARSE';
throw err;
}
}

@@ -20,6 +28,12 @@ exports.readJson5File = readJson5File;

const text = await readFileWithoutBom(filePath);
return {
data: JSON.parse(text),
text,
};
try {
return {
data: parseJson(text, filePath),
text,
};
}
catch (err) {
err['code'] = 'ERR_PNPM_JSON_PARSE';
throw err;
}
}

@@ -26,0 +40,0 @@ exports.readJsonFile = readJsonFile;

{
"name": "@pnpm/read-importer-manifest",
"version": "1.0.1",
"version": "1.0.2",
"description": "Read an importer manifest (called package.json in most cases)",

@@ -17,4 +17,3 @@ "main": "lib/index.js",

"prepublishOnly": "tsc",
"tsc": "tsc",
"md": "mos"
"tsc": "tsc"
},

@@ -44,2 +43,3 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/read-importer-manifest",

"json5": "2.1.0",
"parse-json": "4.0.0",
"read-yaml-file": "1.1.0",

@@ -56,5 +56,4 @@ "strip-bom": "4.0.0"

"@types/node": "^10.3.2",
"@types/parse-json": "4.0.0",
"@types/tape": "^4.2.31",
"mos": "^2.0.0-alpha.3",
"mos-plugin-readme": "^1.0.4",
"tape": "^4.8.0",

@@ -65,11 +64,3 @@ "tempy": "0.3.0",

"typescript": "3.4.5"
},
"mos": {
"plugins": [
"readme"
],
"installation": {
"useShortAlias": true
}
}
}

@@ -25,2 +25,2 @@ # @pnpm/read-importer-manifest

[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io/)
MIT © [Zoltan Kochan](https://www.kochan.io/)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet