Skip to content
amobizPublic

About

Join paths and globs.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Repository files navigation

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

About

Join paths and globs.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages