Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/get-yo-rc-path
Get the path of the nearest .yo-rc.json file
https://github.com/dustinspecker/get-yo-rc-path
Last synced: 2 days ago
JSON representation
Get the path of the nearest .yo-rc.json file
- Host: GitHub
- URL: https://github.com/dustinspecker/get-yo-rc-path
- Owner: dustinspecker
- License: mit
- Created: 2015-10-27T00:17:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T21:42:04.000Z (over 7 years ago)
- Last Synced: 2024-10-16T11:03:48.101Z (23 days ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# get-yo-rc-path
[![NPM version](https://badge.fury.io/js/get-yo-rc-path.svg)](https://badge.fury.io/js/get-yo-rc-path) [![Build Status](https://travis-ci.org/dustinspecker/get-yo-rc-path.svg)](https://travis-ci.org/dustinspecker/get-yo-rc-path) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/get-yo-rc-path.svg)](https://coveralls.io/r/dustinspecker/get-yo-rc-path?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/get-yo-rc-path/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/get-yo-rc-path) [![Dependencies](https://david-dm.org/dustinspecker/get-yo-rc-path.svg)](https://david-dm.org/dustinspecker/get-yo-rc-path/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/get-yo-rc-path/dev-status.svg)](https://david-dm.org/dustinspecker/get-yo-rc-path/#info=devDependencies&view=table)
> Get the path of the nearest .yo-rc.json file
## Install
```
npm install --save get-yo-rc-path
```## Usage
### ES2015
```javascript
// directory structure
// /user/
// - home/
// - awesome-project/
// - script.js
// - .yo-rc.json// script.js
import getYoRcPath from 'get-yo-rc-path';getYoRcPath().then(yoRcPath => {
// => yoRcPath = '/user/home/.yo-rc.json'
});getYoRcPath.dir().then(yoRcDir => {
// => yoRcPath = '/user/home'
});
```### ES5
```javascript
// directory structure
// /user/
// - home/
// - awesome-project/
// - script.js
// - .yo-rc.json// script.js
var getYoRcPath = require('get-yo-rc-path');getYoRcPath().then(function (yoRcPath) {
// => yoRcPath = '/user/home/.yo-rc.json'
});getYoRcPath.dir().then(function (yoRcDir) {
// => yoRcPath = '/user/home'
});
```## API
### getYoRcPath()
Returns a Promise that resolves to a String of the full path or null if not found.### getYoRcPath.dir()
Returns a Promise that resolves to a String of the directory or null if not found.## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)