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

coffee-toaster-api

v1.0.2

Published

Minimalist build system for CoffeeScript based ExtendScripts.

Downloads

4

Readme

coffee-toaster-api

Build Status Coverage Status Dependency Status

Minimalist build system for CoffeeScript.

This is based on Coffee Toaster.

Getting Started

Install the module with:

$ npm install coffee-toaster-api --save

Options

options:
  vendors: []
  exclude: []
  bare: false
  packaging: true
  expose: null
  minify: true
  callback: null
  release: null

vendors

Type Array Default []

An ordered array of all your vendor's paths. These files must be purely javascript, preferably minified ones -- Toaster will not compile or minify them, only concatenate everything.

exclude

Type Array Default []

Let's you excplicity exclude some folder, file or file type from Toaster search/process mechanism. The string you use here will effectively turn into a RegExp like that:

new RegExp '.DS_store'
new RegExp '.swp'
new RegExp 'my/folder/to/be/excluded'

bare

Type Boolean Default false

If true, compile your CoffeeScript files without the top-level function safety wrapper.

packaging

Type Boolean Default false

If true, Toaster will rewrite all your class declarations.

If you have a file in src/app/models/user.coffee with this contents:

class User

Toaster will rewrite your declaration prepending a namespace to it, based on the folder the class is located, resulting -- in this example -- into this:

class app.models.User

This rewriting process is saved directly into your file. In case you move this class to another folder, the prepended namespace will be rewrited again, always following your folder structure.

In other words, your don't need to worry about hardcoded namespaces in your files, because Toaster will handle all the dirty for you.

expose

Type String Default null

If informed, list all you packages of classes in the given scope. If you use window as your expose scope, your classes will be available also in the window object -- or whatever scope you inform, suck as exports if you're building for NodeJS.

In the end you'll be able to access your files throught this scope where your classes was exposed.

new window.app.models.User
new exports.app.models.User

minify

Type Boolean Object Default null

If true, minify your release file using UglifyJS.

If object, it will be passed directly to UglifyJS.

options:
  minify:
    output:
      beautify: true
      indent_level: 2

callback

Type Function Default null

Lets you modify the generated contents.

options:
  callback: (contents, minified) ->
    contents.replace('foo', 'bar')

release

Type String Default null

The file path to your release file.

Usage Examples

Build the sources from the src folder, prepend the example.js vendor and compile it to lib/app.js

var Toaster = require("coffee-toaster-api");

options = {
  bare: false,
  minify: false,
  vendors: ["vendor/example.js"],
  folders: "src/app":"app",
  release: "lib/app.js"
}

var toaster = new Toasty(process.cwd(), options);
toaster.build();

Contributing

I Love Open Source

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.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright (c) 2013 We Are Interactive under the MIT license.

Bitdeli Badge