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-inline-map

v0.9.0

Published

Compile CoffeeScript files with inline source maps

Downloads

49

Readme

changequote([,])dnl

coffee-inline-map

Compile CoffeeScript files with inline source maps.

Features

  • Error reporting similar to the original CoffeeScript compiler.
  • .litcoffee support.

Example

$ cat a.coffee
include([a.coffee])
$ coffee-inline-map a.coffee | fold -w72
syscmd([../../../bin/coffee-inline-map a.coffee | fold -w72])

$ coffee-inline-map -h
syscmd([../../../bin/coffee-inline-map -h])

Installation

# npm install -g coffee-inline-map

Compilation

$ make compile

browserify & make-commonjs-depend

To verify the text below you'll need to clone this repo, run 'make compile' & install [make-commonjs-depend].

Look into repo's test/data directory. Ignore *.should files. I'll wait.

Then

$ cd src
$ ls *coffee
syscmd([ls *coffee])

Here main.coffee depends on a.coffee & b.litcoffee. For out site we need just 1 public/bundle.js file which will include the result form the compilations of our all CoffeeScript files.

We want to rebuild public/bundle.js only & only on .coffee files change. That's obviously a job for make.

$ cat Makefile
include([Makefile])

To create a dependency tree, we run

$ make depend
syscmd([make depend | egrep -v '(Entering|Leaving) directory'])
$ cat js.mk
include([js.mk])

It's unfortunate that make-commonjs-depend supports only javascript. That's why before running it, make needs to compile all coffescript files.

Then compile the bundle

$ make compile
syscmd([make compile | egrep -v '(Entering|Leaving) directory'])

As a little homework, try to guess why main.js was recompiled here, when at first glance it should rather not.

Run again

$ make compile
syscmd([make compile | egrep -v '(Entering|Leaving) directory'])

Notice that the nothing was recompiled for the 2nd time. That's our goal!

$ touch a.coffee
$ make compile
syscmd([touch a.coffee; make compile | egrep -v '(Entering|Leaving) directory'])

Yay! Then open public/index.html in Chrome and switch to the console view. (Make sure to turn on 'Enable source maps' in Developer Tool's settings.)

Jeez mate, why are you doing this rigmarole?

Every dependency & every file should be compiled/processed only once.

This seems meaningless for a bunch of small .coffee files but becomes very useful for large projects with several complex browserify output targets.

Why not just use coffeeify plugin for browserify?

  1. browserify can't (& shouldn't) check changes in our source files to decide whether it's time to recompile.
  2. Error reporting.

Why are you using outdated make instead of cake, jake, grunt, gulp or broccoli? It's not 1977 anymore!

facepalm.jpg

Dude. Take a walk for 10 minutes & no one will get hurt.

BUGS

  • Reading from stdin doesn't work in Windows.

NEWS

0.9.0

  • CoffeeScript 1.10.0.

...

0.5.0

  • CoffeeScript 1.8.0.

0.4.0

  • CoffeeScript 1.7.1
  • 'New' source map syntax.

0.3.0

  • -b CLO.
  • Include 'generated by ...' header.

0.2.0

  • Update for CoffeeScript 1.6.3.
  • Recognize .coffee.md extension.
  • -l CLO.

0.1.0

  • Add reading from stdin.
  • Fix an unheplful crash for EPIPE error.

License

MIT.