Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Installations
npm install @dsherret/to-absolute-glob
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=0.10.0
Node Version
8.5.0
NPM Version
3.8.8
Score
99.4
Supply Chain
99.4
Quality
74
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
jonschlinkert
Download Statistics
Total Downloads
72,258,715
Last Day
27,619
Last Week
106,897
Last Month
579,615
Last Year
7,331,791
GitHub Statistics
18 Stars
45 Commits
11 Forks
4 Watching
1 Branches
7 Contributors
Bundle Size
2.00 kB
Minified
834.00 B
Minified + Gzipped
Package Meta Information
Latest Version
2.0.2
Package Id
@dsherret/to-absolute-glob@2.0.2
Size
3.35 kB
NPM Version
3.8.8
Node Version
8.5.0
Publised On
07 Mar 2018
Total Downloads
Cumulative downloads
Total Downloads
72,258,715
Last day
-15.4%
27,619
Compared to previous day
Last week
-29.8%
106,897
Compared to previous week
Last month
3.4%
579,615
Compared to previous month
Last year
-16%
7,331,791
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
2
to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Install
Install with npm:
1$ npm install --save to-absolute-glob
Usage
1var toAbsGlob = require('to-absolute-glob'); 2toAbsGlob('a/*.js'); 3//=> '/dev/foo/a/*.js'
Examples
Given the current project folder (cwd) is /dev/foo/
:
makes a path absolute
1toAbsGlob('a'); 2//=> '/dev/foo/a'
makes a glob absolute
1toAbsGlob('a/*.js');
2//=> '/dev/foo/a/*.js'
retains trailing slashes
1toAbsGlob('a/*/'); 2//=> '/dev/foo/a/*/'
retains trailing slashes with cwd
1toAbsGlob('./fixtures/whatsgoingon/*/', {cwd: __dirname});
2//=> '/dev/foo/'
makes a negative glob absolute
1toAbsGlob('!a/*.js');
2//=> '!/dev/foo/a/*.js'
from a cwd
1toAbsGlob('a/*.js', {cwd: 'foo'});
2//=> '/dev/foo/foo/a/*.js'
makes a negative glob absolute from a cwd
1toAbsGlob('!a/*.js', {cwd: 'foo'});
2//=> '!/dev/foo/foo/a/*.js'
from a root path
1toAbsGlob('/a/*.js', {root: 'baz'});
2//=> '/dev/foo/baz/a/*.js'
from a root slash
1toAbsGlob('/a/*.js', {root: '/'});
2//=> '/dev/foo/a/*.js'
from a negative root path
1toAbsGlob('!/a/*.js', {root: 'baz'});
2//=> '!/dev/foo/baz/a/*.js'
from a negative root slash
1toAbsGlob('!/a/*.js', {root: '/'});
2//=> '!/dev/foo/a/*.js'
About
Related projects
- has-glob: Returns
true
if an array has a glob pattern. | homepage - is-glob: Returns
true
if the given string looks like a glob pattern or an extglob pattern… more | homepage - is-valid-glob: Return true if a value is a valid glob pattern or patterns. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Commits | Contributor |
---|---|
16 | doowb |
15 | jonschlinkert |
1 | phated |
1 | erikkemperman |
Building docs
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
1$ npm install -g verb verb-generate-readme && verb
Running tests
Install dev dependencies:
1$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.2.0, on October 17, 2016.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/micromatch/.github/SECURITY.md:1
- Info: Found linked content: github.com/micromatch/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/micromatch/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/micromatch/.github/SECURITY.md:1
Reason
Found 3/14 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/micromatch/to-absolute-glob/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/micromatch/to-absolute-glob/ci.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:30
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 21 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More