JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1820
  • Score
    100M100P100Q144383F
  • License MIT

Return `true` if a file path ends with the given string/suffix.

Package Exports

  • path-ends-with

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (path-ends-with) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

path-ends-with NPM version Build Status

Return true if a file path ends with the given string/suffix.

Install

Install with npm

$ npm i path-ends-with --save

Install with bower

$ bower install path-ends-with --save

Usage

var endsWith = require('path-ends-with');

endsWith('foo\\bar\\baz\\', '/');
//=> true
endsWith('foo\\bar\\baz\\', '\\');
//=> true
endsWith('foo/bar/baz/', '/');
//=> true
endsWith('foo/bar/baz', 'baz');
//=> true
endsWith('foo/bar/baz', 'bar/baz');
//=> true
endsWith('foo\\bar\\baz.md', 'baz.md');
//=> true
endsWith('foo\\bar\\baz.md', '.md');
//=> true
endsWith('foo\\bar\\baz.md', 'bar/baz.md');
//=> true
endsWith('foo\\bar\\baz.md', '/');
//=> false
endsWith('foo\\bar\\baz.md', 'baz');
//=> false

Other useful libraries for working with paths in node.js:

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on October 04, 2015.