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

babelator

v0.2.26

Published

A collection of default convention-based common tasks for modules using Babel.

Downloads

99

Readme

babelator

A complete set of Gulp tasks for creating modern Javascript modules

Babelator is part of the Live Ecosystem :seedling:

NPM Version Linux Build Test Coverage

Quick Start

Use Drum to create a new Babelator module.

npm i -g drum
drum g babelator

Manual Setup

npm i -D babelator gulpjs/gulp.git#4.0

Add the following to your gulpfile.js:

var gulp = require('gulp')
require('babelator')(gulp)

You can now use: npm run gulp <task-name>.

Usage

npm run gulp <task-name>

See Tasks.

Dev

Compile on file change.

npm i
npm run gulp watch

Tasks

TODO: This section should be a print out from running gulp help...

gulp build - Cleans dist, then compiles src -> dist. Suitable as npm prepublish script in package.json.

gulp watch - Watches for changes. Compiles src -> dist on file change. Only compiles changed files. Cleans on first run.

gulp test - Runs tests.

gulp test-transpiled - Runs transpiled tests. Faster.

gulp test-watch - Watches for changes, and compiles + runs transpiled tests.

gulp bootstrap - Boostraps a module. Modifies package.json, etc. Prompts for any file being overwritten.

Workflow

We want to minimize the time spent waiting for npm installs. You should be able to create a new module and publish to npm super quick.


# `npm link` babelator, gulp 4.0, and babel for quicker installs
# NOTE: Gulp 4.0 globally supports 3.x and 4.x local installs. So don't worry about it breaking gulp 3.x projects.

git clone https://github.com/vjpr/babelator.git && cd babelator && npm link
git clone https://github.com/gulpjs/gulp.git && git checkout -b 4.0 origin/4.0 && cd gulp && npm link
git clone https://github.com/babel/babel.git && cd babel && make build && cd packages/babel && npm link

# Bootstrap new project

cd ~/dev
mkdir <new-project-name>
babelator
# Answer some questions...
gulp bootstrap
# Answer some questions...
gulp watch # or gulp test-watch
gulp nodemon
# Hack, hack, hack...

# Publish to npm/bower and deploy to gh-pages

gulp bump
gulp publish # npm/bower deploy
gulp deploy # gh-pages, etc.

Local module cache

Use local npm module cache. E.g. npm_lazy.

npm i -g npm_lazy
npm_lazy --init > ~/npm_lazy.config.js

# Now use:
npm --registry http://localhost:8080/ install

# Or set it as an alias in ~/.bashrc:
echo -e "alias npml='npm --registry http://localhost:8080/'" >> ~/.bashrc

Slow startup

If you have a slow startup make sure you put all your requires inside your tasks.

Even though modules are cached on first require, common requires like lodash may still be loaded twice depending on their version and when they were installed. So to be safe, task-scope everything.

npm3 will help fix this by deduping.

Run gulp --require time-require --sorted x to see whats taking so much time.

As of 31 Oct, 2015 = 1s + 711 require()

License

MIT