Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antora/expand-path-helper

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/expand-path-helper

A helper function to expand a path to an absolute path, first resolving leading shorthands such as tilde (~) and tilde plus (~+).

  • 1.0.0-rc.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
increased by3.67%
Maintainers
2
Weekly downloads
 
Created
Source

@antora/expand-path-helper

A node module that exports a helper function to expand a path to an absolute path, first resolving leading shortcuts such as tilde (~) and tilde plus (~+). Developed for use in Antora.

Install

$ npm i @antora/expand-path-helper

or

$ yarn add @antora/expand-path-helper

Usage

*nix

const expandPath = require('@antora/expand-path-helper')

expandPath('/absolute/path')
//=> /absolute/path

expandPath('foo/bar')
//=> /current/directory/foo/bar

expandPath('~/foo/bar')
//=> /home/user/foo/bar

expandPath('~+/foo/bar')
//=> /current/directory/foo/bar

Windows

const expandPath = require('@antora/expand-path-helper')

expandPath('C:\\absolute\\path')
//=> C:\absolute\path

expandPath('foo\\bar')
//=> C:\current\directory\foo\bar

expandPath('~\\foo\\bar')
//=> C:\Users\user\foo\bar

expandPath('~+\\foo\\bar')
//=> C:\current\directory\foo\bar

On Windows, the input path may contain forward slashes, but the expanded path will always have backslashes.

Copyright (C) 2018 OpenDevise Inc. and the Antora Project.

Use of this software is granted under the terms of the Mozilla Public License Version 2.0 (MPL-2.0).

Keywords

FAQs

Package last updated on 22 Feb 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc