replace-homedir

WebJar for replace-homedir

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

replace-homedir
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

replace-homedir
WebJar for replace-homedir
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/gulpjs/replace-homedir

Download replace-homedir

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/replace-homedir/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>replace-homedir</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/replace-homedir/
implementation 'org.webjars.npm:replace-homedir:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/replace-homedir/
implementation ("org.webjars.npm:replace-homedir:1.0.0")
'org.webjars.npm:replace-homedir:jar:1.0.0'
<dependency org="org.webjars.npm" name="replace-homedir" rev="1.0.0">
  <artifact name="replace-homedir" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='replace-homedir', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "replace-homedir" % "1.0.0"
[org.webjars.npm/replace-homedir "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : homedir-polyfill jar [1.0.1,2)
org.webjars.npm : is-absolute jar [1.0.0,2)
org.webjars.npm : remove-trailing-separator jar [1.1.0,2)

Project Modules

There are no modules declared in this project.

replace-homedir

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Replace user home in a string with another string. Useful for tildifying a path.

Usage

var replaceHomedir = require('replace-homedir');

var shortPath = replaceHomedir('/Users/phated/myProject', '~');
// shortPath === '~/myProject'

API

replaceHomedir(path, replacement)

Takes a string path as the first argument and a string or function replacement as the second argument. If the path is absolute and begins with the User's homedir, the homedir portion of the path is replaced with replacement using String#replace.

If path is not a string, the function will throw.

License

MIT

org.webjars.npm

gulp

A toolkit to automate & enhance your workflow

Versions

Version
1.0.0