Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
deprecated-obj
Advanced tools
Compares deprecations against a configuration object, and returns a compliant object and violations
Simple utility to help making the transition from deprecated configuration objects to compliant ones.
const Deprecation = require('deprecation');
const myConfig = {
fine: true,
old: {
deprecated: true
},
'remove.me': 1
};
const deprecations = {
old: {
deprecated: 'new.shiny'
},
'remove.me': null
};
// Or flat:
const deprecations = { 'old.deprecated': 'new.shiny', 'remove.me': null };
const deprecation = new Deprecation(deprecations, myConfig);
Deprecation::getCompliant()
const myCompliant = deprecation.getCompliant();
→ { fine: true, new: { shiny: true } }
Returns a new, compliant object. The null
values in deprecations
are excluded.
Deprecation::getViolations()
const violations = deprecation.getViolations();
→ { 'old.deprecated': 'new.shiny', 'remove.me': null }
The violations can be used to inform the user about the deprecations, for example:
if (Object.keys(violations).length > 0) {
console.warn(`Deprecated configuration options found. Please migrate before the next major release.`);
}
for (let deprecated in violations) {
console.warn(`The "${deprecated}" option is deprecated. Please use "${violations[deprecated]}" instead.`);
}
See github.com/release-it/.../deprecated.js for a real-world example.
FAQs
Compares deprecations against a configuration object, and returns a compliant object and violations
The npm package deprecated-obj receives a total of 65,360 weekly downloads. As such, deprecated-obj popularity was classified as popular.
We found that deprecated-obj 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.