1.0.0 • Published 7 years ago

is-safe-path v1.0.0

Weekly downloads
18
License
MIT
Repository
github
Last release
7 years ago

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.