Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Extracts the name of monorepo project
npm install corename
getCoreName(pkgJson: Array<pkgJsonObj>|Object)
import getCoreName from "corename";
const pkg0 = {
name: "pkg-first",
dependencies: {},
};
const pkg1 = {
name: "@pkg-second",
dependencies: {
"@pkg/first": "^0.1.5",
},
};
const pkg2 = {
name: "@pkg/third",
dependencies: {},
};
const name = getCoreName([pkg0, pkg1, pkg2]);
// name = "@pkg";
Or just pass a single package
const name = getCoreName(pkg2);
// name = "@pkg";
In case there's no matching pattern, it returns null:
const name = getCoreName(pkg1);
// name = null;
Or tell it to return the exact name found in package.json
const returnNameIfMonoNotFound = true;
const name = getCoreName(pkg1, returnNameIfMonoNotFound);
// name = "@pkg-second";
npm test
This project is licensed under the GPL-3.0 License
builderz - JavaScript Bundler with zero configuration.
packageSorter - Sorting packages for monorepos production.
get-info - Utility functions for projects production
move-position - Moves element index in an array.
textics & textics-stream - Counts lines, words, chars and spaces for a given string.
folo - Form & Layout Components Built with React.
FAQs
> Extracts the name of monorepo project
The npm package corename receives a total of 7 weekly downloads. As such, corename popularity was classified as not popular.
We found that corename demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.