You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.6 KiB

4 years ago
  1. # expand-tilde [![NPM version](https://img.shields.io/npm/v/expand-tilde.svg?style=flat)](https://www.npmjs.com/package/expand-tilde) [![NPM downloads](https://img.shields.io/npm/dm/expand-tilde.svg?style=flat)](https://npmjs.org/package/expand-tilde) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/expand-tilde.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/expand-tilde)
  2. > Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the user home directory, or `~+` to the cwd.
  3. ## Install
  4. Install with [npm](https://www.npmjs.com/):
  5. ```sh
  6. $ npm install --save expand-tilde
  7. ```
  8. ## Usage
  9. See the [Bash documentation for Tilde Expansion](https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html).
  10. ```js
  11. var expandTilde = require('expand-tilde');
  12. expandTilde('~')
  13. //=> '/Users/jonschlinkert'
  14. expandTilde('~+')
  15. //=> process.cwd()
  16. ```
  17. ## Run tests
  18. Install dev dependencies:
  19. ```bash
  20. npm i -d && npm test
  21. ```
  22. ## About
  23. ### Related projects
  24. * [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.")
  25. * [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
  26. * [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
  27. * [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")
  28. ### Contributing
  29. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
  30. ### Building docs
  31. _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
  32. To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
  33. ```sh
  34. $ npm install -g verb verb-generate-readme && verb
  35. ```
  36. ### Running tests
  37. Install dev dependencies:
  38. ```sh
  39. $ npm install -d && npm test
  40. ```
  41. ### Author
  42. **Jon Schlinkert**
  43. * [github/jonschlinkert](https://github.com/jonschlinkert)
  44. * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  45. ### License
  46. Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
  47. Released under the [MIT license](LICENSE).
  48. ***
  49. _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 08, 2016._