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

gulp-accord

v0.2.0

Published

a unified interface to compiled javascript languages

Downloads

14

Readme

gulp-accord

npm tests dependencies

A fast, simple, and well-tested way to compile many languages with a unified interface.

Note: This project is in early development, and versioning is a little different. Read this for more details.

Why should you care?

You're hip and modern, and you know that it makes life a lot easier to use compiled languages when you are writing html, css, and/or javascript. So many of your projects use tools like jade, stylus, sass, or coffeescript, and build them out to vanilla html, css, and javascript before deploys. It also just so happens that you use and love gulp as your build tool.

While you can certainly find one-off adapters for each of these languages, wouldn't it be easier if they all had a consistent, unified, and well-tested interface that always supports all options, and the latest version of the language? And wouldn't it be nice to just have to install a single gulp plugin to handle all of them? If you answered yes to any of the above, that is why you should care.

Language Support

Gulp-accord supports these languages at the moment. Below you can find a usually-up-to-date adapter list:

If there are other languages you would like for accord to support, please make your suggestions and pull requests to accord itself, not to this plugin.

Installation

npm install --save gulp-accord

Also make sure that you have the language you want to compile with accord installed. So for example, if you are using gulp to compile jade, you'd also run npm install jade --save. Don't worry too much though, if you forget to do this, the plugin will kindly remind you.

Usage

Below is an example of basic usage. In this case, we would be using gulp-accord to compile some jade templates.

var accord = require('gulp-accord');

gulp.task('compile', function(){
  gulp.src('templates/*.jade')
  .pipe(accord('jade', { pretty: true }))
});

As you can probably infer from this example, the accord plugin takes two arguments, the name of the language you are compiling, and the options you want to pass to it. The name should be a string, and the options are optional, but if present, should be an object. You can find more information about the available options for each language here.

Source Maps

If a language has support for source maps, this plugin will allow you to product them using gulp's standard sourcemaps tool. You can use it as specified in the docs, and gulp-accord will produce the sourcemaps for you automatically. For example, the task shown below would compile a stylus file and produce an external sourcemap:

var gulp = require('gulp'),
    sourcemaps = require('gulp-sourcemaps'),
    accord = require('gulp-accord');

gulp.task('default', function(){
  gulp.src('./test.styl')
  .pipe(sourcemaps.init())
  .pipe(accord('stylus'))
  .pipe(sourcemaps.write('.'))
  .pipe(gulp.dest('./out'))
});

License & Contributing