chushihua
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
|
||||
module.exports = function (str) {
|
||||
return path.resolve(str) === path.resolve(process.cwd());
|
||||
};
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "is-path-cwd",
|
||||
"version": "1.0.0",
|
||||
"description": "Check if a path is CWD",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-path-cwd",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"cwd",
|
||||
"pwd",
|
||||
"check",
|
||||
"filepath",
|
||||
"file",
|
||||
"folder"
|
||||
],
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
# is-path-cwd [](https://travis-ci.org/sindresorhus/is-path-cwd)
|
||||
|
||||
> Check if a path is [CWD](http://en.wikipedia.org/wiki/Working_directory)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save is-path-cwd
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isPathCwd = require('is-path-cwd');
|
||||
|
||||
isPathCwd(process.cwd());
|
||||
//=> true
|
||||
|
||||
isPathCwd('unicorn');
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user