globjoin
Join paths and globs.
Last updated 2 months ago by amobiz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install globjoin 
SYNC missed versions from official npm registry.

globjoin

Join paths and globs.

npm

chart

Install

$ npm install globjoin

API

Like Node's path.join(), which joins all arguments and normalizes the resulting path, globjoin accepts an arbitrary number of paths and/or arrays of globs, joins them together, and handles negative globs.

function globjoin(...globs: Array<string>): string;

function globjoin(...globs: Array<string | string[]>): string[];

Important: Starting with version 1.0.0, negative globs are handled differently. Negative globs are now treated as negations of the corresponding path segments. For example:

globjoin(["src", "!app", "!view"]) => "src/app/view"

While in version 0.1.4, the same input produced:

globjoin(["src", "!app", "!view"]) => "!src/app/view"

This is a breaking behavior change to be aware of when upgrading to version 1.0.0.

Example

import globjoin from "globjoin";

const globs1 = globjoin("src", ["**/*.js", "!**/test*.js"]);

const globs2 = globjoin(
  "test",
  "fixture",
  "app",
  ["views", "!services"],
  ["**/*", "!*.{js,json,coffee,ts}"],
);

Check out test for more examples.

Issues

Issues

Test

$ npm test

Changelog

Changelog

License

MIT

Author

Amobiz

Contributor

StreetStrider

Current Tags

  • 1.0.1                                ...           latest (2 months ago)

6 Versions

  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 0.1.4                                ...           11 years ago
  • 0.1.3                                ...           11 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 15
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (12)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE