Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@dsherret/to-absolute-glob
Advanced tools
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Install with npm:
$ npm install --save to-absolute-glob
var toAbsGlob = require('to-absolute-glob');
toAbsGlob('a/*.js');
//=> '/dev/foo/a/*.js'
Given the current project folder (cwd) is /dev/foo/
:
makes a path absolute
toAbsGlob('a');
//=> '/dev/foo/a'
makes a glob absolute
toAbsGlob('a/*.js');
//=> '/dev/foo/a/*.js'
retains trailing slashes
toAbsGlob('a/*/');
//=> '/dev/foo/a/*/'
retains trailing slashes with cwd
toAbsGlob('./fixtures/whatsgoingon/*/', {cwd: __dirname});
//=> '/dev/foo/'
makes a negative glob absolute
toAbsGlob('!a/*.js');
//=> '!/dev/foo/a/*.js'
from a cwd
toAbsGlob('a/*.js', {cwd: 'foo'});
//=> '/dev/foo/foo/a/*.js'
makes a negative glob absolute from a cwd
toAbsGlob('!a/*.js', {cwd: 'foo'});
//=> '!/dev/foo/foo/a/*.js'
from a root path
toAbsGlob('/a/*.js', {root: 'baz'});
//=> '/dev/foo/baz/a/*.js'
from a root slash
toAbsGlob('/a/*.js', {root: '/'});
//=> '/dev/foo/a/*.js'
from a negative root path
toAbsGlob('!/a/*.js', {root: 'baz'});
//=> '!/dev/foo/baz/a/*.js'
from a negative root slash
toAbsGlob('!/a/*.js', {root: '/'});
//=> '!/dev/foo/a/*.js'
true
if an array has a glob pattern. | homepagetrue
if the given string looks like a glob pattern or an extglob pattern… more | homepagePull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Commits | Contributor |
---|---|
16 | doowb |
15 | jonschlinkert |
1 | phated |
1 | erikkemperman |
(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:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.2.0, on October 17, 2016.
FAQs
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
We found that @dsherret/to-absolute-glob demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.