
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
assert-path
Advanced tools
Extends node's assert module with methods for testing filepaths.
Install with npm
$ npm i assert-path --save
var assert = require('assert');
require('assert-path')(assert);
Returns true if path.dirname of filepath a equals filepath b.
assert.dirname(a, b);
Example
assert.dirname('a/b/c.js', 'a/b/c');
//=> true
Returns true if path.basename of filepath a equals filepath b.
assert.basename(a, b);
Example
assert.basename('a/b/ccc.js', 'ccc.js');
//=> true
Returns true if path.filename of filepath a equals filepath b.
assert.filename(a, b);
Example
assert.filename('a/b/ccc.js', 'ccc');
//=> true
Returns true if path.extname of filepath a equals filepath b.
assert.extname(a, b);
Example
assert.extname('a/b/c.js', '.js');
//=> true
Returns true if filepath a equals filepath b.
assert.path(a, b);
Example
assert.path('a/b/c.js', 'a/b/c.js');
//=> true
Returns true if path.resolve(a) equals path.resolve(b).
assert.absolute(a, b);
Example
assert.absolute('a/b/c.js', 'a/b/c.js');
//=> true
Returns true if the last nth segments of a equals the last nth segments of b. For example, the last 2 segments of foo/bar/baz/qux.md would be baz/qux.md.
assert.segments(a, b, 2);
Example
// b/c.js === 'b/c.js'
assert.segments('a/b/c.js', 'a/b/c.js');
//=> true
Returns true if the last nth segments of a equals b.
assert.lastSegments(a, b, 2);
Example
assert.lastSegments('a/b/c/d/e.js', 'd/e.js', 2);
//=> true
Returns true if a filepath is absolute.
assert.isAbsolute(filepath);
Example
assert.isAbsolute('a/b/c.js');
//=> false
assert.isAbsolute(path.resolve('a/b/c.js'));
//=> false
Returns true if path.resolve(a) equals path.resolve(b).
assert.isRelative(filepath);
Example
assert.isRelative('a/b/c.js');
//=> true
assert.isRelative(path.resolve('a/b/c.js'));
//=> false
true if the path appears to be relative. | homepageInstall dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on November 08, 2015.
FAQs
Extends node's assert module with methods for testing filepaths.
The npm package assert-path receives a total of 3 weekly downloads. As such, assert-path popularity was classified as not popular.
We found that assert-path 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.