Socket
Socket
Sign inDemoInstall

@pnpm/write-project-manifest

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/write-project-manifest - npm Package Compare versions

Comparing version 4.0.2 to 4.1.0

2

lib/index.d.ts

@@ -0,5 +1,7 @@

import { CommentSpecifier } from '@pnpm/text.comments-parser';
import { ProjectManifest } from '@pnpm/types';
export declare function writeProjectManifest(filePath: string, manifest: ProjectManifest, opts?: {
comments?: CommentSpecifier[];
indent?: string | number | undefined;
insertFinalNewline?: boolean;
}): Promise<void>;

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

const path_1 = __importDefault(require("path"));
const text_comments_parser_1 = require("@pnpm/text.comments-parser");
const json5_1 = __importDefault(require("json5"));

@@ -24,7 +25,16 @@ const write_file_atomic_1 = __importDefault(require("write-file-atomic"));

const trailingNewline = opts?.insertFinalNewline === false ? '' : '\n';
const json = (fileType === 'json5' ? json5_1.default : JSON)
.stringify(manifest, undefined, opts?.indent ?? '\t');
const indent = opts?.indent ?? '\t';
const json = (fileType === 'json5'
? stringifyJson5(manifest, indent, opts?.comments)
: JSON.stringify(manifest, undefined, indent));
return (0, write_file_atomic_1.default)(filePath, `${json}${trailingNewline}`);
}
exports.writeProjectManifest = writeProjectManifest;
function stringifyJson5(obj, indent, comments) {
const json5 = json5_1.default.stringify(obj, undefined, indent);
if (comments) {
return (0, text_comments_parser_1.insertComments)(json5, comments);
}
return json5;
}
//# sourceMappingURL=index.js.map

15

package.json
{
"name": "@pnpm/write-project-manifest",
"version": "4.0.2",
"version": "4.1.0",
"description": "Write a project manifest (called package.json in most cases)",

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

],
"repository": "https://github.com/pnpm/pnpm/blob/main/packages/write-project-manifest",
"repository": "https://github.com/pnpm/pnpm/blob/main/pkg-manifest/write-project-manifest",
"keywords": [

@@ -24,13 +24,14 @@ "pnpm7",

},
"homepage": "https://github.com/pnpm/pnpm/blob/main/packages/write-project-manifest#readme",
"homepage": "https://github.com/pnpm/pnpm/blob/main/pkg-manifest/write-project-manifest#readme",
"dependencies": {
"@pnpm/types": "8.9.0",
"json5": "^2.2.1",
"write-file-atomic": "^4.0.2",
"write-yaml-file": "^4.2.0"
"write-yaml-file": "^4.2.0",
"@pnpm/text.comments-parser": "1.0.0",
"@pnpm/types": "8.9.0"
},
"devDependencies": {
"@pnpm/write-project-manifest": "4.0.2",
"@types/write-file-atomic": "^3.0.3",
"tempy": "^1.0.1"
"tempy": "^1.0.1",
"@pnpm/write-project-manifest": "4.1.0"
},

@@ -37,0 +38,0 @@ "funding": "https://opencollective.com/pnpm",

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