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

@augment-vir/node-js

Package Overview
Dependencies
Maintainers
1
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@augment-vir/node-js - npm Package Compare versions

Comparing version 10.0.0 to 11.0.0

8

dist/augments/json.d.ts

@@ -0,5 +1,9 @@

import { PartialAndNullable } from '@augment-vir/common';
import { JsonArray, JsonObject, JsonValue } from 'type-fest';
export declare function readJson<T extends JsonValue>(path: string): Promise<T>;
export declare function writeJson<T extends JsonObject | JsonArray>(path: string, data: T): Promise<void>;
export declare function appendJson<T extends JsonObject | JsonArray>(path: string, data: T): Promise<void>;
export type WriteJsonOptions = PartialAndNullable<{
includeTrailingNewLine: boolean;
}>;
export declare function writeJson<T extends JsonObject | JsonArray>(path: string, data: T, options?: WriteJsonOptions | undefined): Promise<void>;
export declare function appendJson<T extends JsonObject | JsonArray>(path: string, data: T, options?: WriteJsonOptions | undefined): Promise<void>;
//# sourceMappingURL=json.d.ts.map

@@ -18,8 +18,9 @@ "use strict";

exports.readJson = readJson;
async function writeJson(path, data) {
async function writeJson(path, data, options) {
await (0, fs_extra_1.ensureDir)((0, path_1.dirname)(path));
await (0, promises_1.writeFile)(path, JSON.stringify(data, null, 4));
const trailingNewLine = (options === null || options === void 0 ? void 0 : options.includeTrailingNewLine) ? '\n' : '';
await (0, promises_1.writeFile)(path, JSON.stringify(data, null, 4) + trailingNewLine);
}
exports.writeJson = writeJson;
async function appendJson(path, data) {
async function appendJson(path, data, options) {
let currentJson = await readJson(path);

@@ -50,4 +51,4 @@ if (typeof currentJson !== 'object') {

}
await writeJson(path, withAppendedData);
await writeJson(path, withAppendedData, options);
}
exports.appendJson = appendJson;
{
"name": "@augment-vir/node-js",
"version": "10.0.0",
"version": "11.0.0",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/node-js",

@@ -5,0 +5,0 @@ "bugs": {

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