is-safe-path

1.0.0 • Public • Published

is-safe-path

Check if a path is safe to use to prevent directory traversal attacks.

Installation

$ npm install is-safe-path

Usage

const isSafePath = require('is-safe-path');

isSafePath('foo/bar'); // => true
isSafePath('foo/../../bar'); // => false

License

Copyright (c) 2017 Martin Kolárik. Released under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    4

Package Sidebar

Install

npm i is-safe-path

Weekly Downloads

4

Version

1.0.0

License

MIT

Last publish

Collaborators

  • martin-kolarik