is-safe-path
v1.0.0
Published
Check if a path is safe to use to prevent directory traversal attacks.
Downloads
315
Readme
is-safe-path
Check if a path is safe to use to prevent directory traversal attacks.
Installation
$ npm install is-safe-pathUsage
const isSafePath = require('is-safe-path');
isSafePath('foo/bar'); // => true
isSafePath('foo/../../bar'); // => falseLicense
Copyright (c) 2017 Martin Kolárik. Released under the MIT license.
