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

many-to-one

v0.0.1

Published

Sync and keep in sync multiple files to one file

Downloads

22

Readme

many-to-one

Edit many files as one. Easily search, replace, move code across several files.

Demo

demo gif

Install

npm install -g many-to-one

Use:

many-to-one src/ bundle.js

Features

  • Syncs all files into one, obeying the order you supply them in
  • Unwatches files you remove from the bundle
  • Creates files you add to the bundle that don't exist
  • Starts watching files you add to the bundle
  • Updates the bundle if you're syncing a folder and add or remove a file in it
  • Can mangle the file names in the bundle if having them is annoying (for search/replace)
  • Supports any language by using different comment syntax

Docs

many-to-one --help
Usage: many-to-one [options] SOURCE ... TARGET

  SOURCE is a path to a file or directory, or a glob
  TARGET is a path to a file that will consist of the combined contents
    of all the files specified by SOURCEs

The command will keep watching both the SOURCEs and the TARGET and sync
them when either change.

Options:
  --comment, -c  The comment syntax used for file headers.
                                                        [string] [default: "//"]
  --ignore, -i   Don't consider these paths/globs for SOURCE files
  --mangle, -m   Mangle the actual source file names in TARGET's headers.
                                                                       [boolean]
  --token, -t    The end token distinguishing file headers from other comments.
                                             [string] [default: "-------------"]
  --verbose, -v  Log watching status.                                  [boolean]
  --help                                                               [boolean]

Examples

Sync a, b and c to bundle, in order b, c, a.

many-to-one b.js c.js a.js bundle.js

Use different comment syntax for other languages.

many-to-one -c '#' src/ bundle.coffee
many-to-one -c '--' src/ bundle.hs

Use different token to end file headers.

many-to-one -t '!!!' src/ bundle.js

You can use block comments too

many-to-one -c '/*' -t '*/' src/ bundle.js

Exclude some files from syncing.

many-to-one -i src/vendor.js src/ bundle.js