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

watch-less-do-more

v0.3.1

Published

Watch less files and their dependency tree for changes & automatically recompile

Downloads

251

Readme

watch-less-do-more CircleCI

Watch less files and their dependency tree for changes & automatically recompile

About

Rather than watching a directory for changes in any files, like other watchers, watch-less-do-more watches your main less file and automatically watches only its dependencies. If the main file, or any of it's dependencies change, the main file is compiled. This also allows you to watch multiple main files in a directory, and only compile the ones that have either changed themselves, or have had their dependencies changed. Additionally, this means that updating your node_modules (if any are dependencies of your less) will cause your less to recompile.

Example

If we have the following files

main-a.less
main-b.less
dependency-of-a.less
dependency-of-b.less
dependency-of-a-and-b.less
not-related-to-other-files.less

And we run the command

watch-less-do-more -i main-a.less -o main-a.css -i main-b.less -o main-b.css
  • Changes to not-related-to-other-files.less will not cause any less to compile.

  • Changes to dependency-of-a-and-b.less will cause both main-a.less and main-b.less to recompile.

  • Changes to dependency-of-a.less will cause only main-a.less to recompile.

  • Changes to dependency-of-b.less will cause only main-b.less to recompile.

Install

Install watch-less-do-more. You'll also need to install less. Currently supports less 2.x.x.

npm install watch-less-do-more less --save

Optionally install postcss if you want to use postcss modules. Currently supports postcss 5.x.x.

npm install postcss --save

Usage

In these examples we're adding a script to our package.json

Single main file

{
  "watch-less": "watch-less-do-more -i source.less -o output.css"
}

Multiple main files

You can define as many files as you like, as long as there is an output argument for every input file

{
  "watch-less": "watch-less-do-more -i source-a.less -o output-a.css -i source-b.less -o output-b.css"
}

PostCSS

You can use PostCSS modules with watch-less-do-more incredibly easily. Just install the modules you want, and tell watch-less-do-more to use them in the same way you would with PostCSS.

{
  "watch-less": "watch-less-do-more -u autoprefixer -i source.less -o output.css"
}

Options

--input, -i   Path to input LESS file                      [string] [required]
--output, -o  Path to output CSS file                      [string] [required]
--use, -u     PostCSS module to use                                   [string]
--help        Show help                                              [boolean]
--version     Show version number                                    [boolean]