Socket
Socket
Sign inDemoInstall

@ark/fs

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ark/fs - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

5

out/fs.d.ts

@@ -28,3 +28,6 @@ export { rmSync } from "node:fs";

export declare const fsRoot: string;
export declare const findPackageRoot: (fromDir?: string) => string;
export declare const findPackageRoot: (fromDir?: string) => string | null;
export declare const assertPackageRoot: (fromDir?: string) => string;
export declare const findPackageAncestors: (fromDir?: string) => string[];
export declare const readPackageJsonAncestors: (fromDir?: string) => any[];
export declare const fromPackageRoot: (...joinWith: string[]) => string;

@@ -31,0 +34,0 @@ export declare const readPackageJson: (startDir?: string) => any;

22

out/fs.js

@@ -81,6 +81,24 @@ import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";

}
return null;
};
export const assertPackageRoot = (fromDir) => {
const startDir = fromDir ?? dirOfCaller();
const result = findPackageRoot(fromDir);
if (result)
return result;
throw new Error(`${startDir} is not part of a node package.`);
};
export const fromPackageRoot = (...joinWith) => join(findPackageRoot(dirOfCaller()), ...joinWith);
export const readPackageJson = (startDir) => readJson(join(findPackageRoot(startDir), "package.json"));
export const findPackageAncestors = (fromDir) => {
const dirs = [];
let dir = fromDir ?? dirOfCaller();
while (dir) {
dir = findPackageRoot(dir);
if (dir)
dirs.push(dir);
}
return dirs;
};
export const readPackageJsonAncestors = (fromDir) => findPackageAncestors(fromDir).map(dir => readPackageJson(dir));
export const fromPackageRoot = (...joinWith) => join(assertPackageRoot(dirOfCaller()), ...joinWith);
export const readPackageJson = (startDir) => readJson(join(assertPackageRoot(startDir), "package.json"));
export const getSourceControlPaths = () =>

@@ -87,0 +105,0 @@ // include tracked and untracked files as long as they are not ignored

@@ -15,3 +15,3 @@ // Copied from unmaintained package https://github.com/bevry/get-current-line to fix imports

try {
/** @ts-expect-error https://github.com/winstonjs/winston/issues/401#issuecomment-61913086 */
// @ts-expect-error https://github.com/winstonjs/winston/issues/401#issuecomment-61913086
const previous = err.__previous__ || err.__previous;

@@ -18,0 +18,0 @@ stack = previous && previous.stack;

{
"name": "@ark/fs",
"version": "0.1.2",
"version": "0.2.0",
"author": {

@@ -5,0 +5,0 @@ "name": "David Blass",

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