Socket
Socket
Sign inDemoInstall

path-browserify

Package Overview
Dependencies
0
Maintainers
39
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    path-browserify

the path module from node core for browsers


Version published
Maintainers
39
Install size
27.3 kB
Created

Package description

What is path-browserify?

The path-browserify npm package is a version of Node.js core path module for the browser. It provides utilities for working with file and directory paths, allowing you to perform operations such as normalization, joining, and resolving paths in a way that is compatible with browser environments.

What are path-browserify's main functionalities?

Normalization

Normalize a string path, taking care of '..' and '.' parts and multiple slashes.

const path = require('path-browserify');
const normalizedPath = path.normalize('/foo/bar//baz/asdf/quux/..');

Joining Paths

Join all arguments together and normalize the resulting path.

const path = require('path-browserify');
const joinedPath = path.join('/foo', 'bar', 'baz/asdf', 'quux', '..');

Resolving Paths

Resolve a sequence of paths or path segments into an absolute path.

const path = require('path-browserify');
const resolvedPath = path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile');

Basename

Get the last portion of a path, similar to the Unix basename command.

const path = require('path-browserify');
const base = path.basename('/foo/bar/baz/asdf/quux.html');

Extension Name

Return the extension of the path, from the last occurrence of the '.' (period) character to end of string in the last portion of the path.

const path = require('path-browserify');
const ext = path.extname('index.html');

Directory Name

Return the directory name of a path, similar to the Unix dirname command.

const path = require('path-browserify');
const dir = path.dirname('/foo/bar/baz/asdf/quux');

Other packages similar to path-browserify

Readme

Source

path-browserify

the path module from node core for browsers

Keywords

FAQs

Last updated on 20 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc