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

grunt-devcode

v0.0.4-c

Published

Remove code blocks based on environment configuration

Downloads

942

Readme

Usage with Yeoman grunt file:

Devcode is a fork of grunt-preprocess project, which has been re-written from scratch at the end. Due to the problems I had with that library, along with an excessive amount of code (additional dependency from "preprocess") and I suppose not fully tested functionality.

Currently, I am not interested in using 'devcode' with standalone grunt, therefore I focused on using it paired up with yeoman. However, if you have any additional suggestions regarding configuration, or the code itself, feel free to comment/send pull requests.

Installation:

  npm install grunt-devcode

Loading devcode into grunt

  grunt.loadNpmTasks('grunt-devcode');

Build task configuration:

  grunt.renameTask('build', 'original-build');
  grunt.registerTask('build', 'original-build devcode');

Devcode configuration:

  devcode :
  {
    files :
    {
      html: true,        // html files parsing?
      js: true,          // javascript files parsing?
      css: true,         // css files parsing?
      clean: true,       // removes devcode comments even if code was not removed
      block: {
        open: 'devcode', // with this string we open a block of code
        close: 'endcode' // with this string we close a block of code
      }
    }
  }

Devcode usage (html files):

<!-- devcode: !production -->
  <li class="right"><a href="#settings" data-toggle="tab">Settings</a></li>
<!-- endcode -->

this code will show for all environment types but production

Devcode usage (js and css files):

// devcode: !production
  body {
    background-color: red;
  }
// endcode

this code will show for all environment types but production

Test:

  yeoman build

Todo

- I was unable to find a way to use devcode with a yeoman server task. I will be happy to accept a pull request, if someone figures it out ;-)
- Little code and config files improvements
- Tests