Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@homer0/package-info
Advanced tools
A tiny service that reads the contents of the project's package.json
, sync & async.
⚠️ This package is only for Node.
import { packageInfo } from '@homer0/package-info';
const pkg = packageInfo();
// ...
const info = await pkg.get();
// or
const info = pkg.getSync();
If your app uses a Jimple container, you can register PackageInfo
as the packageInfo
service by using its provider:
import { packageInfoProvider } from '@homer0/package-info';
// ...
container.register(packageInfoProvider);
// ...
const info = container.get('packageInfo');
And since the provider is a "provider creator" (created with my custom version of Jimple), you can customize its service name:
container.register(
packageInfoProvider({
serviceName: 'myPackageInfo',
}),
);
PackageInfo
depends on the following services, and when used with Jimple, it will try to find them in the container, otherwise, it will create new instances:
@homer0/path-utils
, with the name pathUtils
. Used to generate the paths relative to the project root.If you already implement the dependencies, but with a different name, you can specify them in the provider:
container.register(
packageInfoProvider({
services: {
pathUtils: 'myPathUtils',
},
}),
);
As this project is part of the packages
monorepo, some of the tooling, like lint-staged
and husky
, are installed on the root's package.json
.
Task | Description |
---|---|
lint | Lints the package. |
test | Runs the unit tests. |
build | Transpiles the project. |
types:check | Validates the TypeScript types. |
FAQs
Gets the content of the project's package.json
We found that @homer0/package-info 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.