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-tusk

v0.1.6

Published

Grunt based build system

Downloads

12

Readme

Grunt-Tusk

GruntJS based build system for frontend web projects.

Features

  • Write your code using CoffeeScript and have it compile into CommonJS modules (this allows you to easily share code between browser and node)
  • Style your web application using SASS (built-in support for Compass, Twitter bootstrap and Font Awesome)
  • Use Jade for all of your templates (static pages compile to html, and dynamic templates compile to javascript)
  • Write a multi-lingual application using I18n-js
  • Automatically live reload your browser when files are changed
  • Use third-party packages using bower
  • Test your code using mocha, chai, sinon and more.

Directory Structure

app/
  coffee/
  i18n/
    en.coffee
    he.coffee
    ...
  images/
  pages/ - static pages (jade -> html)
    index.jade - compiled to index.html
    _layout.jade - files starting with _ are ignored, useful for layouts and partials
    ...
  stylesheets/
  templates/
    index.jade - compiled to JS code and accessable via JST["index"]
    ...

test/
  test.jade - test runner template
  *_spec.coffee - test files
  
build/ - production output
public/ - development output

Output - Development

public/
  index.html

  vendor.js
  templates.js
  app.js
  i18n/
    en.js
    he.js
    ...
    
  app.css
  images/
  fonts/
  
  test.html
  test.js
  test_vendor.js

Output - Production

build/
  index.html
  app.js - a combined version for vendor.js, templates.js, i18n/en.js and app.js
  app
  i18n/
    he.js
    ...
    
  app.css
  images/
  fonts/

Configuration

  • Add tusk to your package.json:
  "dependencies": {
    "grunt": "~0.4.0",
    "grunt-tusk": "~0.0.1"
  },
  • Add the following to your Gruntfile.coffee:
module.exports = (grunt) ->

  tusk = require 'grunt-tusk'
  tusk.initialize grunt,
    scripts:
      vendor: [
        'components/jquery/jquery.js'
        'components/underscore/underscore.js'
        'components/backbone/backbone.js'
        'components/i18n-js/vendor/assets/javascripts/i18n.js'
        'components/marionette/lib/backbone.marionette.js'
        'components/bootstrap-sass/js/bootstrap-tooltip.js'
        'components/bootstrap-sass/js/bootstrap-affix.js'
        'components/bootstrap-sass/js/bootstrap-alert.js'
        'components/bootstrap-sass/js/bootstrap-button.js'
        'components/bootstrap-sass/js/bootstrap-carousel.js'
        'components/bootstrap-sass/js/bootstrap-collapse.js'
        'components/bootstrap-sass/js/bootstrap-dropdown.js'
        'components/bootstrap-sass/js/bootstrap-modal.js'
        'components/bootstrap-sass/js/bootstrap-popover.js'
        'components/bootstrap-sass/js/bootstrap-scrollspy.js'
        'components/bootstrap-sass/js/bootstrap-tab.js'
        'components/bootstrap-sass/js/bootstrap-transition.js'
        'components/bootstrap-sass/js/bootstrap-typeahead.js'
        ]
      test_vendor: [
        'components/mocha/mocha.js',
        'components/chai/chai.js',
        'components/sinon.js/sinon.js',
        'components/sinon-chai/lib/sinon-chai.js'
        ]
    copy: [
      { source: 'components/bootstrap-sass/img', dest: 'images' }
      { source: 'components/font-awesome/font', dest: 'fonts' }
    ]

  • Add the following packages to bower's component.json file:
{
  "dependencies": {
    "bootstrap-sass": "2.2.2",
    "mocha": "1.8.1",
    "chai": "1.4.2",
    "sinon.js": "*",
    "sinon-chai": "git://github.com/domenic/sinon-chai#2.3.1",
    "font-awesome": "3.0.2",
    "underscore": "1.4.4",
    "backbone": "0.9.10",
    "marionette": "1.0.0-rc5",
    "i18n-js": "git://github.com/fnando/i18n-js"
  }
}

Template

See grunt-tusk-template for a basic template to get start faster.