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

grunt2gulp

v0.0.3

Published

converts Gruntfile.js to a gulpjs-compatible file

Downloads

16

Readme

grunt2gulp

Grunt2Gulp Logo

Codacy Badge

Download it on NPM: npm install grunt2gulp

Converts a Gruntfile.js to a gulp-compliant file. Why? Because if you're going to create a new tool to replace an old one, why not automate the process of porting configuration files over.

In the future, a standard for building JavaScript files should emerge and be usable by whatever build tools exist. Maybe something like GNU Make? Ah, but that's a mere fantasy...

Usage

Print out a gulp file to standard output:

grunt2gulp.js Gruntfile.js

Save the generated gulp file:

grunt2gulp.js Gruntfile.js > gulpfile.js

Drawbacks, Caveats

This is a very very rough tool, you will need to go over the generated gulp file to ensure that it works and is correct.

To see the difference, run the examples/simple-gruntfile.js through grunt2gulp and compare it to examples/simple-gulpfile.js. It got 90% of the way to a complete conversion though and it took only a bit of tweaking to get it to that state.

If there are duplicate tasks, a warning is added to the code.

How does it work?

It loads up the Gruntfile and emulates Grunt's API. When it's done looping through all the tasks in the grunt config, it shoves them into definitions or tasks. Definitions are non-objects, like strings, which need to be declared as variables when using Gulp. Tasks are converted into Gulp tasks but some special cases have to be handled, such as Karma and Watch.

Hacking on grunt2gulp

The code is dirty because Grunt is very permissive in its input. You can specify files in multiple ways: as a string, as a list of strings, or within a files property as a string or list. If Grunt were more modular it would be possible to just rip out the parser that Grunt uses to turn a config into a set of tasks without also importing the task running capability and all the other stuff.

The core functions you will want to check out are processGruntTask and processGruntConfig.

How to Report Issues

When reporting an issue with grunt2gulp.js, please try to include the Gruntfile that you were trying to convert and the error message that you received.

You can report issues here: https://github.com/omouse/grunt2gulp.js/issues

Documentation

You can generate the documentation using jsdoc:

jsdoc node_modules/grunt2gulp/bin/grunt2gulp.js

License

Licensed under the GPL version 3 or later.

Copyright (C) 2014-2016 Rudolf Olah [email protected]

See LICENSE for full text of license.