Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iguntur/lazy-dir
Lazy define current directory
https://github.com/iguntur/lazy-dir
cwd dir join path pwd resolve
Last synced: about 12 hours ago
JSON representation
Lazy define current directory
- Host: GitHub
- URL: https://github.com/iguntur/lazy-dir
- Owner: iguntur
- License: mit
- Created: 2018-12-01T08:30:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-05T19:02:31.000Z (almost 6 years ago)
- Last Synced: 2024-04-26T23:43:08.403Z (7 months ago)
- Topics: cwd, dir, join, path, pwd, resolve
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# lazy-dir
> Lazy define current directory
[![Travis CI](https://img.shields.io/travis/iguntur/lazy-dir.svg?style=flat-square)](https://travis-ci.org/iguntur/lazy-dir)
[![node](https://img.shields.io/node/v/lazy-dir.svg?style=flat-square)]()
[![npm](https://img.shields.io/npm/v/lazy-dir.svg?style=flat-square)](https://www.npmjs.org/package/lazy-dir)
[![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat-square)]()---
## Install
```console
$ npm install lazy-dir
```## Usage
```js
const dir = require('lazy-dir')(module);console.log(dir.here());
//=> /path/to/project/awesomeconsole.log(dir.here('foo', 'bar'));
//=> /path/to/project/awesome/foo/bar
```## API
### require('lazy-dir')(`module`);
- Params:
- `module`: `` _(required)_
- Returns: ``#### .pwd(`[...paths]`)
- Params:
- `...paths`: `` _(optional)_
- Returns: ``
- Example:
```js
dir.pwd('a', 'b', 'c'); // eq: path.resolve(process.cwd(), 'a', 'b', 'c')
```#### .here(`[...paths]`)
- Params:
- `...paths`: `` _(optional)_
- Returns: ``
- Example:
```js
dir.here('a', 'b', 'c'); // eq: path.resolve(__dirname, 'a', 'b', 'c')
```## License
MIT © [Guntur Poetra](http://github.com/iguntur)