Skip to content

Commit 267f110

Browse files
committed
Scaffold: Normalize repository
1 parent 18e2b29 commit 267f110

File tree

14 files changed

+213
-101
lines changed

14 files changed

+213
-101
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
end_of_line = lf
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "gulp"
3+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.gitignore

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
.nyc_output
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# Compiled binary addons (http://nodejs.org/api/addons.html)
21+
build/Release
22+
23+
# Dependency directory
24+
# Commenting this out is preferred by some people, see
25+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
126
node_modules
2-
npm-debug.log
27+
28+
# Users Environment Variables
29+
.lock-wscript
30+
31+
# Garbage files
32+
.DS_Store

.jshintrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
sudo: false
12
language: node_js
23
node_js:
3-
- "0.10"
4+
- '10'
5+
- '8'
6+
- '6'
7+
- '4'
8+
- '0.12'
9+
- '0.10'
10+
after_script:
11+
- npm run coveralls

LICENSE

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
Copyright (c) 2014 Tyler Kellen
1+
The MIT License (MIT)
22

3-
Permission is hereby granted, free of charge, to any person
4-
obtaining a copy of this software and associated documentation
5-
files (the "Software"), to deal in the Software without
6-
restriction, including without limitation the rights to use,
7-
copy, modify, merge, publish, distribute, sublicense, and/or sell
8-
copies of the Software, and to permit persons to whom the
9-
Software is furnished to do so, subject to the following
10-
conditions:
3+
Copyright (c) 2014-2018 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>
114

12-
The above copyright notice and this permission notice shall be
13-
included in all copies or substantial portions of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1411

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22-
OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# empty-dir [![Build Status](https://secure.travis-ci.org/js-cli/js-empty-dir.svg?branch=master)](http://travis-ci.org/js-cli/js-empty-dir)
2-
> Check if a directory is empty.
1+
<p align="center">
2+
<a href="http://gulpjs.com">
3+
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
4+
</a>
5+
</p>
36

4-
[![NPM](https://nodei.co/npm/empty-dir.png)](https://nodei.co/npm/empty-dir/)
7+
# empty-dir
58

6-
## Install
9+
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
710

8-
Install with [npm](https://www.npmjs.com/):
9-
10-
```sh
11-
$ npm install --save empty-dir
12-
```
11+
Check if a directory is empty.
1312

1413
## Usage
1514

@@ -28,10 +27,19 @@ var result = emptyDir.sync('./test/empty');
2827
console.log('Directory is empty:', result);
2928
```
3029

31-
## Filter function
30+
## API
3231

33-
Both async and sync take a filter function as the second argument, to ignore files like `.DS_Store` on mac or `Thumbs.db` on windows from causing false-negatives.
32+
### `emptyDir(paths, [filterFunction], callback)`
33+
34+
Takes a path string or array of path strings and a callback function. Checks if the given paths are empty and passes any `error` and an `isEmpty` flag to the callback. Optionally takes a filter function before the callback to filter out files that cause false positives.
3435

36+
### `emptyDir.sync(paths, [filterFunction])`
37+
38+
Same as the above API but operates and returns synchronously. An error will be thrown.
39+
40+
#### Filter function
41+
42+
Both async and sync take a filter function as the second argument, to ignore files like `.DS_Store` on mac or `Thumbs.db` on windows from causing false-negatives.
3543

3644
```js
3745
var emptyDir = require('empty-dir');
@@ -52,8 +60,22 @@ var isEmpty = emptyDir.sync('./test/empty', filter);
5260
console.log('Directory is empty:', isEmpty);
5361
```
5462

55-
## Release History
63+
## License
64+
65+
MIT
66+
67+
[downloads-image]: http://img.shields.io/npm/dm/empty-dir.svg
68+
[npm-url]: https://www.npmjs.com/package/empty-dir
69+
[npm-image]: http://img.shields.io/npm/v/empty-dir.svg
70+
71+
[travis-url]: https://travis-ci.org/gulpjs/empty-dir
72+
[travis-image]: http://img.shields.io/travis/gulpjs/empty-dir.svg?label=travis-ci
73+
74+
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/empty-dir
75+
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/empty-dir.svg?label=appveyor
76+
77+
[coveralls-url]: https://coveralls.io/r/gulpjs/empty-dir
78+
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/empty-dir/master.svg
5679

57-
* 2018-03-09 - v1.0.0 - refactored "isEmpty" logic so that it returns early, as soon as a non-filtered file is encountered, instead of filtering the entire list and comparing against length. Also allows an array to be passed (this avoids having to call `fs.readdir()` multiple times).
58-
* 2016-02-07 - v0.2.0 - add filter support
59-
* 2014-05-08 - v0.1.0 - initial release
80+
[gitter-url]: https://gitter.im/gulpjs/gulp
81+
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg

appveyor.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# http://www.appveyor.com/docs/appveyor-yml
2+
# http://www.appveyor.com/docs/lang/nodejs-iojs
3+
4+
environment:
5+
matrix:
6+
# node.js
7+
- nodejs_version: "0.10"
8+
- nodejs_version: "0.12"
9+
- nodejs_version: "4"
10+
- nodejs_version: "6"
11+
- nodejs_version: "8"
12+
- nodejs_version: "10"
13+
14+
install:
15+
- ps: Install-Product node $env:nodejs_version
16+
- npm install
17+
18+
test_script:
19+
- node --version
20+
- npm --version
21+
- cmd: npm test
22+
23+
build: off
24+
25+
# build version format
26+
version: "{build}"

0 commit comments

Comments
 (0)