Product
Introducing Socket Optimize
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
@visulima/package
Advanced tools
One Package to rule them all, finds your root-dir, monorepo, package manager or tsconfig.json
One Package to rule them all, finds your root-dir, monorepo, package manager or tsconfig.json is built on top of
@visulima/fs, jsonc-parser, normalize-package-data, pathe, resolve-pkg-maps and type-fest
Daniel Bannert's open source work is supported by the community on GitHub Sponsors
npm install @visulima/package
yarn add @visulima/package
pnpm add @visulima/package
Find the root directory path and strategy for a monorepo based on the given current working directory (cwd).
import { findMonorepoRoot } from "@visulima/package";
// or import { findMonorepoRoot } from '@visulima/package/monorepo';
const root = findMonorepoRoot(); // => /Users/../Projects/visulima
Find the root directory path and strategy for a package based on the given current working directory (cwd).
import { findPackageRoot } from "@visulima/package";
// or import { findPackageRoot } from '@visulima/package/package';
const root = findPackageRoot(); // => /Users/../Projects/visulima/packages/package
Find the package.json file in the specified directory or its parent directories.
import { findPackageJson } from "@visulima/package";
// or import { findPackageJson } from '@visulima/package/package-json';
const root = findPackageJson(); // => /Users/../Projects/visulima/packages/package/package.json
Writes the package.json file with the given data.
import { writePackageJson } from "@visulima/package";
// or import { writePackageJson } from '@visulima/package/package-json';
writePackageJson({ name: "visulima" } /* ,{ cwd: "./" }*/);
Parse the package.json file.
import { parsePackageJson } from "@visulima/package";
const packageJson = parsePackageJson(/* object or package.json as string */);
Asynchronously finds a lock file in the specified directory or any of its parent directories.
import { findLockFile } from "@visulima/package";
// or import { findLockFile } from '@visulima/package/package-manager';
const lockFile = await findLockFile(); // => /Users/../Projects/visulima/packages/package/package-lock.json
Finds the package manager used in a project based on the presence of lock files or package.json configuration.
If found, returns the package manager and the path to the lock file or package.json.
Throws an error if no lock file or package.json is found.
import { findPackageManager } from "@visulima/package";
// or import { findPackageManager } from '@visulima/package/package-manager';
const { packageManager, path } = findPackageManager(); // => { packageManager: 'npm', path: '/Users/../Projects/visulima/packages/package' }
Retrieves the version of the specified package manager.
import { getPackageManagerVersion } from "@visulima/package";
// or import { getPackageManagerVersion } from '@visulima/package/package-manager';
const version = await getPackageManagerVersion("npm"); // => 7.5.4
Retrieves the TsConfig by searching for the "tsconfig.json" file from a given current working directory.
import { findTsConfig } from "@visulima/package";
// or import { findTsConfig } from '@visulima/package/tsconfig';
const tsconfig = await findTsConfig(); // => { path: "/Users/../Projects/visulima/packages/package/tsconfig.json", config: { compilerOptions: { ... } } }
Writes the provided TypeScript configuration object to a tsconfig.json file.
import { writeTsConfig } from '@visulima/package';
// or import { writeTsConfig } from '@visulima/package/tsconfig';
writeTsConfig({ compilerOptions: { ... } }/* ,{ cwd: "./" }*/);
Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
If you would like to help take a look at the list of issues and check our Contributing guild.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
The visulima package is open-sourced software licensed under the MIT
FAQs
One Package to rule them all, finds your root-dir, monorepo, or package manager.
The npm package @visulima/package receives a total of 1,202 weekly downloads. As such, @visulima/package popularity was classified as popular.
We found that @visulima/package demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.