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

air-drop-flatiron

v0.0.3

Published

air-drop for flatiron

Downloads

8

Readme

AirDrop for flatiron

AirDrop is a Node.js Connect middleware for compiling, concatenating and minimizing your JS/Coffee source files and delivering them to the browser on-the-fly.

Personally I think this approach is preferable to using build scripts, file watchers, etc.

Now it's for flatiron too.

Install

Install with npm:

npm install air-drop-flatiron

You can run the specs with npm as well:

API

See AirDrop repo

Flatiron integration

var flatiron  = require('flatiron')
  , app       = flatiron.app
  , AirDrop   = require('air-drop-flatiron')
  , ecstatic  = require('ecstatic')
  , package   = AirDrop('my-pack').require('js/jquery-1.7.2.js', {name: 'jquery'})
                                  .require('js/jquerypp.js', {name: 'jquerypp'})
                                  .require('js/can.jquery-1.0.5.js', {name: 'can'})
                                  // .package().minimize().cache();    

app.use(flatiron.plugins.http, {
  before: [
    ecstatic(__dirname + '/public')
  ]
});

//app is now AirDrop aware (app.AirDrop('foo-pack').include...)
//you can defined AirDrop packages before app.use(flatiron.plugins.http) or after
app.use(AirDrop);

//When a package is created AirDrop set automatically routes to Director for handling this package
AirDrop('second-pack').include('public/js/**/*.js')

app.init(function () {  
  app.start(3000);
  console.log({"starting": "on", "www": "http://localhost:3000"}, "info");
});

Current issues

Windows

Currently, AirDrop is not working on windows because of path resolving (nightmare on windows: path c:/foo/bar is resolved as c:\\foo\\bar) and it makes bad things on Path AirDrop module.

Second issue on windows is usage of glob. glob wants input with forward-slach (accept /foo/bar and not \\foo\\bar). Still path resolution in AirDrop has to fix path before using glob.

I sent a pull request to AirDrop to fix these issues.

Last, but not the least, glob is not working with windows absolute path (eg: glob('c:/foo/bar')).

I sent a pull request to glob to fix these issues.

AirDrop

AirDrop accept required module to be named:

// in your Node script
var package = AirDrop("my-package").require(__dirname + "/../node_modules/underscore/underscore.js", {name: "underscore"});

// in the browser
var _ = require("underscore");

But this currently only work if you use .package() otherwise option {name: "foo"} is not used. I sent a pull request to fix this issue and make it working with air-drop-flatiron.