Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: path-is-inside
node v6.17.1
version:
1.0.0
endpoint
share
tweet
const pathIsInside = require("path-is-inside") const {normalize} = require('path'); const relativePath = '/a/b/c/../../'; const inside = '/a/b'; console.log(`checking to see if ${normalize(relativePath)} is inside of ${inside}`); console.log(pathIsInside(relativePath, inside)); console.log(pathIsInside('/a/', inside));
Created from: https://npm.runkit.com/path-is-inside
Loading…
no comments
sign in
to comment