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

yoo

v1.8.7

Published

jump-start your front-end server

Downloads

128

Readme

Yoo

kangaroo

Jump-start your front-end server. Bundles and configures the boilerplate of a Koa app.

Originally inspired by tj/serve. Then inspired by lapwinglabs/roo.

Goal

Similar to how Heroku ushers you towards the Twelve-Factor App, the goal of Yoo is to provide smart defaults for quickly building front-end servers, while keeping the library small and configurable.

As the server landscape changes, we'll be adding and removing features. We will increment the major version each time we make these sorts of changes.

Some ideas of features we're currently considering:

  • Express middleware support using http-context.
  • Configurable logging using bole.
  • Pluggable message queues to encourage stateless servers.
  • Multipart support
  • BrowserSync / LiveReload support

Installation

Using the API:

npm install yoo

Features

  • Flexible: Javascript
  • Deployable: Ready to be deployed to Dokku or Heroku
  • Composable: Mount Koa servers within or mount within other Koa servers.
  • Higher-level: Templating, Routing & Asset Bundling baked-in

Example

API:

Yoo(__dirname)
  .auth('username', 'password')
  .get('/', 'index.jade')
  .exec('make build')
  .mount('/api', api)
  .compress()
  .serve('build')
  .cors()
  .listen(4000);

API

Yoo(root)

Initialize Yoo at the root path. Defaults to ..

Yoo.{get,post,put,delete,...}(route[, middleware, ...], handle)

Add a route to Yoo. Routing is powered by kr, so visit there for API details.

Additionally, you may pass a filepath to handle, which will render using consolidate.

yoo
  .get('/', 'index.jade')
  .post('/signup', signup)
Yoo.favicon(path)

Set a favicon at path

Yoo.auth(user, pass)

Add basic auth with a user and pass.

Yoo.logger([fn])

Add route logging with an optional filter fn.

yoo.logger(function(ctx) {
  return extname(ctx.url) ? false : true;
});

ctx in this case is a "koa context".

Yoo.exec(command)

Execute a command every refresh

Yoo.use(generator)

Pass additional middleware generator's to Yoo.

Yoo.mount(path)

Mount inside another app at path.

app.use(yoo.mount('/dashboard'));
Yoo.mount(path, app)

Mount an app inside of Yoo at path

yoo.mount('/dashboard', app);
Yoo.compress()

Compress CSS and JS assets.

Yoo.directory()

Yoo the entire directory using koa-serve-index

Yoo.static(directory)

Add a static asset directory to yoo from

Yoo.cors([options])

Enable CORS on the yoo. options get passed directly to node-cors.

Yoo.listen(port, fn)

Start the server on port. You may pass the environment variable PORT=8080 in to specify a port. Otherwise it defaults to 3000 if otherwise not specified.

Test

npm install
make test

Why Yoo?

Yoo is short for Kangaroo. I wrote this while visiting Australia for CampJS and I have Kangaroos on my mind.

Credits

Kangaroo Icon by Olivier Guin

License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.