Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
List and load dependencies.
Based on https://github.com/jackfranklin/gulp-load-plugins.
Returns an array of dependency names.
argument | type | default | description |
---|---|---|---|
scope | array | ['dependencies', 'devDependencies', 'peerDependencies'] | list of dependency types |
config | string or object | 'package.json' | path to package.json file or custom config object |
var deps = ldep.list(['dependencies']);
var deps = ldep.list(['devDependencies'], './package.json');
Attaches dependency names to a single variable. Dependencies are lazy loaded only when the dependency name is accessed.
argument | type | description |
---|---|---|
deps | array | list of dependency names |
rename | function | function to customize name of each dependency. Takes 2 arguments - name of dependency and camelize function (which converts gulp-plugin to gulpPlugin ) - and returns the modified name |
var deps = ldep.list();
var $ = ldep.load(deps);
// or simply
var $ = ldep.load(ldep.list());
// now instead of doing this
var moduleName = require('module-name');
// use it like this
$.moduleName // moduleName is loaded now
var $ = ldep.load(ldep.list(['devDependencies'])), function(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
});
This is a wrapper for multimatch implemented as multimatch(deps, match)
.
argument | type |
---|---|
match | string or array |
deps | array |
var deps = ldep.list();
// get only gulp plugins
var gulpPlugins = ldep.like('gulp-*', deps);
// or simply
var gulpPlugins = ldep.like('gulp-*', ldep.list());
// get only grunt plugins
var gruntPlugins = ldep.like('grunt-contrib-*', ldep.list());
npm install ldep
var ldep = require('ldep');
// load gulp plugins and rename them by removing 'gulp-' prefix and camelizing
var $ = ldep.load(ldep.like('gulp-*', ldep.list()), function(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
});
// load gulp plugins only from devDependencies
var $ = ldep.load(ldep.like('gulp-*', ldep.list(['devDependencies'])), function(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
});
// or
var deps = ldep.list(['devDependencies']);
var gulpPlugins = ldep.like('gulp-*', deps);
function renameGulpPlugins(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
}
var plugins = ldep.load(gulpPlugins, renameGulpPlugins);
FAQs
List and load dependencies.
The npm package ldep receives a total of 2 weekly downloads. As such, ldep popularity was classified as not popular.
We found that ldep 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.