This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

pathsfilter
TypeScript icon, indicating that this package has built-in type declarations

1.2.8 • Public • Published

pathsfilter

CI/CD MIT typescript npm github

table of contents

About

A library for nodejs to filter paths like a .gitignore, .dockerignore or .npmignore file.

Example

import {
    matchPathSelector,
    parsePathSelector,
} from "pathsfilter"

const pathSelectorScript = parsePathSelector(`
    *
    !test/*
    test/logs/*
    !**/keep
    **/nkeep
`)
const toFilter = [
    "qwe",
    "znhghngh.test",
    "keep",
    "nkeep",
    "test.asdd",
    "test/asdasd",
    "test/znhghngh.test",
    "test/test.asdd",
    "test/keep",
    "test/nkeep",
    "test/logs/asdasd",
    "test/logs/znhghngh.test",
    "test/logs/test.asdd",
    "test/logs/keep",
    "test/logs/nkeep",
]
const result = toFilter.filter(
    (v) => !matchPathSelector(v, pathSelectorScript)
)
/* this is the result:
result = [
  "keep",
  "test/asdasd",
  "test/znhghngh.test",
  "test/test.asdd",
  "test/keep",
  "test/logs/keep",
]
*/

npm scripts

The npm scripts are made for linux but can also work on mac and windows.

use

You can run npm scripts in the project folder like this:

npm run <scriptname>

Here is an example:

npm run test

base scripts

You can find all npm scripts in the package.json file. This is a list of the most important npm scripts:

  • test // test the app
  • build // build the app
  • exec // run the app
  • start // build and run the app

watch mode

Like this example you can run all npm scripts in watch mode:

npm run start:watch

contribution

    1. fork the project
    1. implement your idea
    1. create a pull/merge request
// please create seperated forks for different kind of featues/ideas/structure changes/implementations

cya ;3
by majo418

Package Sidebar

Install

npm i pathsfilter

Weekly Downloads

15

Version

1.2.8

License

MIT

Unpacked Size

14.3 kB

Total Files

5

Last publish

Collaborators

  • npm-support