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

jako

v1.0.4

Published

<p align="center"><img src="./.github/logo.png" width="215" /><p> <br>

Downloads

2

Readme

  • Zero setup: There is no need to configure jako, and setting it up is as easy as moving your current scripts to a folder.

  • Polyglot: You are free to write your scripts using any language you want.

  • Translucent: Forget about build tools that force you to write code that only work for that specific runner. As a principle, all the scripts run by jako need to be executable also without jako. No vendor lock, less API to keep track of.

  • Extensible and modular: jako doesn't hold you back while your project is growing. Encapsulate as many independent projects as you want in a single repo and jako will let you run all your scripts from a centralized place.

The name jako comes from "JAKe + Opinionated".

Jake is the JavaScript build tool for NodeJS. Jake has been around since the very early days of Node, and is very full featured and well tested.

In essence, jako is just a tiny but powerful wrapper around jake. Under the hood, jako combines the maturity of a battle-tested codebase with a modern architecture.

divider

Getting started

Installing it

You can install it from one of these 3 options:

globally, with NPM

  $ npm install -g jako

globally, with Yarn

  $ yarn global add jako

locally

you may also install it as a development dependency in a package.json file:

    // package.json
    "devDependencies": {
      "jako": "latest"
    }

Then install it with either npm install or yarn install

Basic usage

jako [options ...] [env variables ...] target

for the full list of available options, please check jake's options.

divider

Writting your first scripts/tasks

Let's create our first script together! To do so, let's imagine you want to have a script that clears all the node_modules folders in your repo.

  1. create a /scripts/clean folder and create a file named node_modules.sh inside it:
$ mkdir -p scripts/clean
$ printf "#\!/bin/bash\nfind . \( -type d -name 'node_modules' \) -exec rm -rf '{}' +" > scripts/clean/node_modules.sh
  1. give it permission to run:
$ chmod +x **/*.sh
  1. run it!
# both calls below should be equivalent:

$ jako clean:node_modules
# or
$ cd ./scripts/clean ; ./node_modules.sh

# running `jako` with no arguments will list the available tasks
$ jako

Keep in mind that you can create scripts folder anywhere you want in your project and jako will adapt to it.

Nesting scripts folders deep inside your project is not only possible but recommended!

divider

Good practices

  • always add shebang to your scripts.
  • always give your scripts permission to run: chmod +x file-path.ext
  • jako will always call your scripts from the directory they are placed in, but not all runners will do that for you. If you, i.e, execute a bash script as ./scripts/clean/node_modules.sh instead of cd ./scripts/clean ; ./node_modules.sh, that could remove folders in different places than the ones you expected. That's why we encourage you to enforce a standardized cwd for all your scripts. In bash you can do that by appending dirname "$0" to the top of your scripts.

divider

Credits

Vector illustration credit: www.vecteezy.com