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.
generator-oniyi
Advanced tools
An opinionated generator for node.js modules. Making use of Babel, AVA, NYC
'use strict'; const toCase = require('to-case'); const extend = require('extend'); const parseAuthor = require('parse-author');
const Base = require('../base');
module.exports = Base.extend({ constructor: function readmeConstructor() { Base.apply(this, arguments);
this.option('codecov', {
type: Boolean,
required: false,
default: false,
desc: 'Include the codecov badge',
});
},
initializing: function readmeInitializing() { this.shouldSkipAll = this.options.yes; this.props = { badges: ['npm', this.options.codecov && 'codecov'].filter(Boolean), }; },
prompting: { badges: function readmeBadges() { const self = this; const prompts = [{ type: 'checkbox', name: 'badges', message: 'Select the badges that you want in your README', choices: [ { name: 'npm' }, { name: 'codecov' }, { name: 'downloads' }, ], default: this.props.badges, when: !this.shouldSkipAll, }];
return this.prompt(prompts).then(answers => {
extend(self.props, answers);
});
},
},
writing: function readmeWriting() { const pkg = this.fs.readJSON(this.destinationPath('package.json'), {}); let authorInfo; if (pkg.author && typeof pkg.author === 'object') { authorInfo = pkg.author; } else if (typeof pkg.author === 'string') { authorInfo = parseAuthor(pkg.author); } else { authorInfo = {}; }
// get githubUsername from repository field
// assume for simplicity that the field has the form
//
// githubUsername/moduleName
//
const githubUsername = (pkg.repository || '').split('/')[0];
extend(this.props, {
githubUsername,
name: authorInfo.name || '',
email: authorInfo.email || '',
website: authorInfo.url || '',
moduleName: (pkg.name || this.appname),
moduleDescription: pkg.description || '',
moduleLicense: pkg.license || '',
});
this.props.camelModuleName = toCase.camel(this.props.moduleName);
this.fs.copyTpl(
this.templatePath('README.tpl'),
this.destinationPath('README.md'),
this.props
);
}, });
FAQs
An opinionated generator for node.js modules. Making use of ESLint, Prettier, Jest, Travis, Coveralls, Husky, and Lint-Staged
The npm package generator-oniyi receives a total of 1 weekly downloads. As such, generator-oniyi popularity was classified as not popular.
We found that generator-oniyi 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.
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.