Browse Source

Rename: get-root-module => this

pull/3/head
Luke Childs 7 years ago
parent
commit
e35116f06f
  1. 20
      README.md
  2. 8
      package.json

20
README.md

@ -1,10 +1,10 @@
# get-root-module
# this
> Traverses up the directory tree and returns the first module found
[![Build Status](https://travis-ci.org/lukechilds/get-root-module.svg?branch=master)](https://travis-ci.org/lukechilds/get-root-module)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/get-root-module/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/get-root-module?branch=master)
[![npm](https://img.shields.io/npm/v/get-root-module.svg)](https://www.npmjs.com/package/get-root-module)
[![Build Status](https://travis-ci.org/lukechilds/this.svg?branch=master)](https://travis-ci.org/lukechilds/this)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/this/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/this?branch=master)
[![npm](https://img.shields.io/npm/v/this.svg)](https://www.npmjs.com/package/this)
Useful in tests so you don't have to require the package you're testing via relative paths.
@ -13,18 +13,18 @@ Starts directory traversal from `process.cwd()` so this should really only be us
## Install
```shell
npm install --save get-root-module
npm install --save this
```
Or if using for tests you'll probably want:
```shell
npm install --save-dev get-root-module
npm install --save-dev this
```
## Usage
Just require `get-root-module` the same way you would require the root module with a relative path.
Just require `this` the same way you would require the root module with a relative path.
e.g instead of:
@ -40,17 +40,17 @@ You can now do:
```js
import test from 'ava';
import myPackage from 'get-root-module';
import myPackage from 'this';
// and then in sub folders it's still just:
import myPackage from 'get-root-module';
import myPackage from 'this';
```
e.g without import transpilation:
```js
const test = require('tape');
const myPackage = require('get-root-module');
const myPackage = require('this');
```
## License

8
package.json

@ -1,5 +1,5 @@
{
"name": "get-root-module",
"name": "this",
"version": "1.0.1",
"description": "Traverses up the directory tree and returns the first module found",
"main": "src/index.js",
@ -12,7 +12,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/lukechilds/get-root-module.git"
"url": "git+https://github.com/lukechilds/this.git"
},
"keywords": [
"find",
@ -24,9 +24,9 @@
"author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
"license": "MIT",
"bugs": {
"url": "https://github.com/lukechilds/get-root-module/issues"
"url": "https://github.com/lukechilds/this/issues"
},
"homepage": "https://github.com/lukechilds/get-root-module",
"homepage": "https://github.com/lukechilds/this",
"dependencies": {
"pkg-dir": "^2.0.0"
},

Loading…
Cancel
Save