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

component-generate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-generate

Create a file based on a template and add it to component.json

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

component-generate Build Status

Create a file based on a template and add it to component.json.

Install

npm install -g component-generate

Usage

$ component generate foo.js

It creates the file foo.js based on the JavaScript default template. It also add the reference to the component.json file.

{
  ...
  "scripts": [
    "foo.js"
  ]
}

Options

Template

-t or --template
You can specify the template you want to use. The templates list is available here.

$ component generate index.js -t templateName

If you want to add a new template, you can add it in template/[extension]/[templateName].tpl and make a PR. Templates are rendered using underscore.
In a future version, we will be able to use local templates. We need to find the simplest way to do it (see issue).

Parameters

-p or --params
Parameters that will be used by the template.

$ component generate index.js -t exports -p name:HomePage

Will render

'use strict';

module.exports = HomePage;

function HomePage() {

}

License

Released under the MIT license

Keywords

FAQs

Package last updated on 27 Feb 2014

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