Coder Social home page Coder Social logo

jonschlinkert / expand-tilde Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 3.0 16 KB

Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the user home directory, or `~+` to the cwd.

License: MIT License

JavaScript 100.00%
tilde expansion expand tilde-expansion javascript nodejs

expand-tilde's Introduction

expand-tilde NPM version NPM downloads Linux Build Status

Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the user home directory, or ~+ to the cwd.

Install

Install with npm:

$ npm install --save expand-tilde

Usage

See the Bash documentation for Tilde Expansion.

var expandTilde = require('expand-tilde');

expandTilde('~')
//=> '/Users/jonschlinkert'

expandTilde('~+')
//=> process.cwd()

Run tests

Install dev dependencies:

npm i -d && npm test

About

Related projects

  • braces: Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… more | homepage
  • expand-brackets: Expand POSIX bracket expressions (character classes) in glob patterns. | homepage
  • is-glob: Returns true if the given string looks like a glob pattern or an extglob pattern… more | homepage
  • micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)

To generate the readme and API documentation with verb:

$ npm install -g verb verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb-generate-readme, v0.2.0, on December 08, 2016.

expand-tilde's People

Contributors

doowb avatar jonschlinkert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

expand-tilde's Issues

Publish TypeScript types for this package

I'm about to submit a PR to DefinitelyTyped that will define TypeScript types for this package. This issue will auto-close when that PR is accepted, after which TypeScript users of this package will be able to install the types the "usual" way, npm i -S expand-tilde @types/expand-tilde. No further action is required on your part. This issue is mostly just a heads-up FYI.

broken for node < v.2.3.0

The package.json lists '"engines": { "node": ">=0.10.0" }', yet uses a method os.homedir() that doesn't exist in 0.10.x or 0.12.x; in fact the node.js API documentation says "Added in: v2.3.0".
Recommended support module: os-homedir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.