npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

et-grunt

v0.1.4

Published

`et-grunt` register tasks with ease. It is a task manager which makes your life easier.

Downloads

5

Readme

et-grunt

Build Status

Grunt task manager including jit-grunt

et-grunt register tasks with ease. It is a task manager which makes your life easier. It also loads tasks when you really need them, using jit-grunt.

Before

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
...

grunt.registerTask('manage:js', [
	'clean:js',
	'concat:js',
]);

grunt.registerTask('manage:assets', [
	'concat:assets',
	'copy:assets',
]);

grunt.registerTask('serve:dev', [
	'clean',
	'manage:js',
	'connect'
]);

After

require('et-grunt')(grunt, {
	manage: {
		js: [
			'clean:js',
			'concat:js'
		],
		assets: [
			'concat:assets',
			'copy:assets'
		]
	},
	serve: {
		dev: [
			'clean',
			'manage:js',
			'connect'
		]
	}
});

Install

npm install et-grunt --save-dev

or

yarn add et-grunt

Usage

require('et-grunt')(grunt, tasksAsObject);
// optional
var jitMappings = {
	yourStaticJitMappings
};

require('et-grunt')(grunt, {
	// task
	manage: {
		// default task, means just 'manage'
		default: [
			'manage:sass',
			'manage:js',
			'manage:app',
		],
		// sub task -> 'manage:js'
		js: [
			'concat:js',
			'concat:vendor',
			'clean:bower'
		],
	},
	minify: {
		js: [
			'manage:js',
			'uglify:js'
		]
	}
}, jitMappings);

Now available in your shell:

grunt manage
grunt manage:js
grunt minify:js

Gruntdefault task

The very first object value should have the value default

default: ['taskName']

Default (taskName)

In every object you can write default as key and et-grunt knows automatically that the following array should be called as default. Example:

taskName: {
	default: ['concat']
}

Available as:

grunt taskName

Subtasks (taskName:subtask)

If you want to have subtasks like manage:js then you have to nest an object into the other object. Example:

taskName: {
	subtask: ['concat:js']
}

Available as:

grunt taskName:subtask

Use jit-grunt

Note: How jit-grunt works can you read here

Use static mappings

The argument after the tasks are reserved for jit static mappings.

var jitMappings = {
	// all settings
};

require('et-grunt')(grunt, tasksAsObject, jitMappings);

Use options

require('et-grunt')(grunt, tasksAsObject)(options);

Example pluginsRoot:

require('jit-grunt')(grunt, tasksAsObject)({
  	pluginsRoot: 'other/dir'
});

Pre-Registered tasks

tasks

Default

see which tasks are available

Run grunt tasks and you will see all available tasks

Extended

  • see which options every task will need

Run grunt tasks:ext or grunt tasks:extended

Release History

  • 2016-12-02 v0.1.2 Fixed unlimited nesting
  • 2015-09-30 v0.1.1 Small fixes
  • 2015-09-30 v0.1.0 Added jit-grunt options support + pre-registered task.
  • 2015-09-25 v0.0.2 Added jit-grunt static maps support.
  • 2015-09-25 v0.0.1 First release.

LICENSE

MIT © Jan Peer Stöcklmair