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 🙏

© 2026 – Pkg Stats / Ryan Hefner

process-dir

v4.0.1

Published

Compile/recompile LS, SASS, etc

Downloads

65

Readme

Process-dir

Process-dir is a configuration-based task runner. Your project config file maps file patterns to commands to run when those files are modified.

Commands are just Linux commands with placeholders for path and config information.

root: "src"
out: "lib"
process:
	"*.ls": "lsc -o {{outDir}} {{path}}"

This compiles LiveScript files in ./src to ./lib.

A process-dir config file is a LiveScript-JSON file called process.json.ls.

Config options

All are optional. Paths are relative to the config file.

root

Path to the source dir. Defaults to the dir containing the config file.

out

Path to the output dir. The name of the source dir will be appended if it ends in /. Defaults to ../compiled/ so if unspecified, the output dir for ./projects/my-project/process.json.ls will be ./projects/compiled/my-project.

process

Map of path patterns to commands. When the commands are executed, placeholders delimited by double braces are replaced with details about the current file and the configuration:

  • out - full path of the out option
  • root - full path of the root option
  • path - full path of the current file
  • name - name of the current file
  • dir - full path of the containing directory of the current file
  • outPath - full path of the file within the output dir
  • outDir - full path of the equivalent directory within the output dir for the current file
  • copy - complete command to copy the source file to the output file

Example:

/projects/express-app/process.json.ls:

out: "../compiled/"
exclude: [
	".git"
	"**/.sass-cache"
]
process:
	"**/*.json.ls": "lsc -j -o {{outDir}} {{path}}"
	"**/*.ls": "lsc -o {{outDir}} {{path}}"
	"**/*.sass":
		update: "sass --cache-location /tmp --update assets/css:{{out}}/assets/css"
init: [
	"sass --cache-location /tmp --update assets/css:{{out}}/assets/css"
]

If we modify /projects/express-app/routes/home/index.ls, the command placeholder values will be:

  • out: /projects/compiled/express-app
  • root: /projects/express-app
  • path: /projects/express-app/routes/home/index.ls
  • name: index.ls
  • dir: /projects/express-app/routes/home
  • outPath: /projects/compiled/express-app/routes/home/index.ls
  • outDir: /projects/compiled/express-app/routes/home
  • copy:
    mkdir -p /projects/compiled/express-app/routes/home
    cp /projects/express-app/routes/home/index.ls /projects/compiled/express-app/routes/home/index.ls

Note that the outPath ends in index.ls, not index.js -- the fact that there is a command defined that means the .ls file will be "turned into" a .js file is not taken into account here.

init

An array of commands to run once at startup. The only placeholders available are out and root.

exclude

An array of patterns to ignore (don't copy, link, or look for matching commands).

Command objects

Commands can be defined as either strings or objects mapping stages to strings. Commands under init are run once at startup; commands under update are run on subsequent modifications to files.

In the above example, we want to update the SASS exactly once on init (not once for each .sass file encountered), and once any time a .sass file is modified thereafter.

Running it

Arguments: [/path/to/project] [-w|--watch]

If no project dir arg is passed, the current directory is used.

I recommend using PM2 or another good node process manager -- here's an example PM2 setup:

pm2 start \
	--name=process-express-app
	--interpreter=/usr/bin/lsc
	/path/to/process-dir/process.ls -- /projects/express-app -w

process-dir will exit if the config file (process.json.ls) is modified -- if you're using a process manager, it will be restarted and use the new config.

You can also just run it in a shell:

$ lsc /path/to/process-dir/process.ls /projects/express-app -w

process-dir will look up the directory tree until it hits / or finds a process.json.ls in the current directory.