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

foso

v0.10.3

Published

A convention over configuration bundler.

Downloads

137

Readme

foso

A convention over configuration bundler.

Dependency Status Build Status npm version Join the chat at https://gitter.im/fosojs/foso

How to install it?

$ npm install --save-dev foso

Why not Gulp/Grunt or friends?

Gulp is a great task runner and has many libraries for bundling JavaScript and styles. However, a lot of configuration has to be done, to write a good gulpfile. Foso's manifesto is simplicity: everything should be bundled with zero configuration.

Foso does a lot with little effort:

  • Bundles the resources with the plugins you install.
  • Watches for changes in the source files and rebundles them on change.
  • Starts a LiveReload server that reloads the browser each time a bundle was updated.
  • Optionally also hosts your resources with a static server.

Plugins

Foso uses plugins to fosify resources. Here are some plugins available for foso:

Why is it convention over configuration?

Lets see why foso is convention over configuration on the example of the fosify-js plugin.

When using vanilla Browserify, each JavaScript file that has to be bundled needs to be specified. Fosify will bundle 2 types of JavaScript files:

  1. Files that are named bundle.js and are not in the source root directory. These files will be bundled, moved one folder up in the destination directory and renamed to the containing folder. For example, /src/foo/bundle.js would be bundled to /dest/foo.js.
  2. Files named [something].bundle.js. These files will be moved to the same directory as in the source folder and will be renamed, so that the bundle suffix is gone. For example, /src/foo/bar.bundle.js would be bundled to /dest/foo/bar.js.

The same conventions are applied in the other fosify plugins.

Usage example in the code

var foso = require('foso');
var less = require('fosify-less');

foso
  .please({
    src: './',
    dest: './dist',
    watch: true,
    minify: true
  })
  .fosify(less)
  .now();

Using foso as a CLI tool

Everything that is foso you can use from the command line. To use foso as a CLI tool, install it globally:

npm install -g foso

However, foso is nothing without its plugins. When you install foso plugins globally, they will be used by foso every time you run it. Install some foso plugins globally:

npm install -g fosify-js fosify-less fosify-html

Now that you have foso and some plugins installed, you can use it to bundle/host your resources.

Commands

Serve

Bundles the resources in the current working directory and sets up a static server to host them.

Example:

foso serve

You can also specify the list of plugins that will be used against the resources. By default all the plugins will be used.

foso serve js less

For minifying the resources you can use the -m option.

foso serve -m

Watch

Bundles the resources in the current working directory and re-bundles them when the source files are updated.

Example:

foso watch

You can also specify the list of plugins that will be used against the resources. By default all the plugins will be used.

foso watch js less

For minifying the resources you can use the -m option.

foso watch -m

Build

Bundles the resources in the current working directory.

Example:

foso build

You can also specify the list of plugins that will be used against the resources. By default all the plugins will be used.

foso build js less

For minifying the resources you can use the -m option.

foso build -m

License

The MIT License (MIT)