pathsfilter
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
-
- fork the project
-
- implement your idea
-
- create a pull/merge request
// please create seperated forks for different kind of featues/ideas/structure changes/implementations
cya ;3
by majo418