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

bundl

v1.1.0

Published

A reinvented build tool

Downloads

45

Readme

Bundl

Become a master of bundles

What Is Bundl?

Bundl builds and packages files for your frontend codebase. It switches the paradigm of when resources are built vs when they are needed (Bundl On-Demand). Use it as a task manager or use it to package your source code with additional resources (like styles and images) into a JavaScript bundle that can be served to your web browser.

Why Use Bundl?

  • Build resoucres only when requested by your browser (and only if they've changed) (Example)
  • Easily concat, require, and wrap all of your various resources to generate the bundle you really need (Example)
  • Run other tasks like linting, file system operations, etc. (Example)
  • Write next generation ES6 JavaScript today with a transpiler plugin (Example)

Get Started

Install

$ cd ~/myProject
$ npm install bundl --save-dev

Create Your Build Script

Make a new file at ~/myProject/bundl.js

var Bundl = require('bundl');

// Plugins
var pack = require('bundl-pack');
var minify = require('bundl-minify');
var write = require('bundl-write');

// Configure
var bundlOptions = {
    outputDir: 'dist/javascripts',
    clean: true
};
var targets = {
    'my_project_bundle.js': 'src/entry.js'
};

// Setup a build pipeline
var myProjectBundl = new Bundl(targets, bundlOptions)
    .then(pack())
    .thenif(Bundl.cliArgs.min, minify())
    .then(write());

// Start the build
myProjectBundl.go();

Run Your Script

$ cd ~/myProject
$ node bundl --min

Run via NPM (optional)

Add scripts to your package.json

{
  "name": "myProject",
  "version": "0.0.1",
  "dependencies": {
    "bundl": "^1.0.0"
  },
  "scripts": {
    "build": "node bundl.js"
  }
}
$ npm run build

How to Use


Build Resources Live On-Demand!

When you make a change to one source file, you shouldn't have to switch back to command line to run a task before you can see your changes live in a browser. You also shouldn't need to wait for every bundle to rebuild if you only want to see one or two of them. Use Bundl's dev server instead...

// Setup a build pipeline
var myProjectBundl = new Bundl(targets, bundlOptions)
    .then(pack())
    .then(write());

// Start live dev mode
myProjectBundl.webserver();

Now, open a browser to http://localhost:5555

HTTP Requests for a bundled resource will check to see if any of the source files within this bundle have changed since last request. If so, the webserver will rebuild the requested bundle before sending it back to the browser.

Learn how to configure a devserver for your project


Debugging

Add --verbose as a command line option to print more info about what's happening

$ node bundl --verbose

Add .debug() to your build chain to print which src files will be bundled into which dest files

new Bundl(targets, bundlOptions).debug();