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

traceur-source-maps

v1.0.6

Published

Provides source map for Node.js files when using Traceur on the fly.

Downloads

191

Readme

traceur-source-maps

NPM version Build status Coveralls status Support us

When using Traceur as a command-line utility to transpile Node.js source code, it provides --source-maps option to create source map files. But when using at runtime by requiring traceur module to live-transpile files, Traceur lacks the ability to reports correct stack trace.

Here comes this module to solve that problem: it provides source map for Node.js files when using Traceur on the fly.

Installation

This module can be installed easily with npm:

$ npm install traceur-source-maps

Usage

Below is a small example to describe how to use this module.

bootstrap.js:

var traceur = require('traceur');

require('traceur-source-maps').install(traceur);

traceur.require.makeDefault(function (filePath) {
  return !~filePath.indexOf('node_modules');
});
// There is no need to pass `{ sourceMaps: true }` as options,
// source mapping is always enabled after install

require('./main');

main.js:

import { hey } from './greet';

hey();

greet.js:

export function hey() {
  hi();
}

export function hi() {
  throw new Error('Call me maybe!');
}

Run bootstrap.js using Node.js, notice the stack trace reports correct line number where the error occurred (line 6 of greet.js).

$ node bootstrap.js

/some/dir/greet.js:6
  throw new Error('Call me maybe!');

        ^
Error: Call me maybe!
    at hi (/some/dir/greet.js:6:9)
    at hey (/some/dir/greet.js:2:3)
    at Object.<anonymous> (/some/dir/main.js:3:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (/some/dir/node_modules/traceur-source-maps/node_modules/traceur/src/node/require.js:65:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/some/dir/bootstrap.js:12:1)

Compatibility

  • This module conflicts with all source code which uses source-map-support module (or maybe some modules with similar features) to provide source mapping.

  • This module has been tested to run properly with Traceur version 0.0.72 (latest version at the time of writing). It could be broken in the future if Traceur introduces non backward-compatible changes. In that circumstance, feel free to create new issue or create a pull request.

Contributing

Before create a pull request, make sure that you:

To execute all tests, simply run:

$ npm test

Contributors

License

This module is released under MIT license.