New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

grunt-plugin-pkg2cmp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-plugin-pkg2cmp

To create a component.json file for bower from the package.json

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

grunt-plugin-pkg2cmp

To create a component.json file for bower from the package.json

Getting Started

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-plugin-pkg2cmp --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-plugin-pkg2cmp');

The "plugin_pkg2cmp" task

Overview

In your project's Gruntfile, add a section named plugin_pkg2cmp to the data object passed into grunt.initConfig().

grunt.initConfig({
  pkg2cmp: {
    options: {
      // overwrite 'main' or 'dependencies' in the package.json here.
    },
    target: {}
  }
})

Options

options.main

Type array or string. Such as ['main.js']

options.dependencies

Type: object. Such as {'jquery': '1.9.2'}

Usage Examples

Default Options

In this example, all of 'name', 'version', 'main' and 'dependencies' will be got from the package.json.

grunt.initConfig({
  pkg2cmp: {
	target: {}
  },
})

Custom Options

In this example, both 'name' and 'version' will be got from the package.json, 'main' will be overwrite to 'main.min.js', 'dependencies' will be added an additional key-value pair in the component.json.

grunt.initConfig({
  plugin_pkg2cmp: {
    options: {
      main: 'main.min.js',
      dependencies: {
		'backbone': '1.0.0'
	  }
    },
    target: {}
  }
})

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

0.1.0 Init version. Copy 'name', 'version', 'main' and 'dependencies' in the package.json to the componenet.json, add allow overwrite 'main' and update 'denpendencies' in the 'options' field.

Keywords

gruntplugin

FAQs

Package last updated on 09 Apr 2013

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