Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

generator-oniyi

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-oniyi

An opinionated generator for node.js modules. Making use of Babel, AVA, NYC

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

'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
);

}, });

Keywords

FAQs

Package last updated on 12 Jul 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc