Skip to content

Commit 70ace59

Browse files
committed
Scaffold: Normalize project
1 parent d5966f6 commit 70ace59

File tree

9 files changed

+159
-77
lines changed

9 files changed

+159
-77
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1-
.DS_Store
1+
# Logs
2+
logs
23
*.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+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# Compiled binary addons (http://nodejs.org/api/addons.html)
20+
build/Release
21+
22+
# Dependency directory
23+
# Commenting this out is preferred by some people, see
24+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
325
node_modules
4-
build
5-
*.node
6-
components
26+
27+
# Users Environment Variables
28+
.lock-wscript
29+
30+
# Garbage files
31+
.DS_Store
32+
33+
# Generated by integration tests
34+
test/fixtures/tmp
35+
test/fixtures/out

.npmignore

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

LICENSE

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
Copyright (c) 2014 Fractal <contact@wearefractal.com>
1+
The MIT License (MIT)
22

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

11-
The above copyright notice and this permission notice shall be
12-
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:
1311

14-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR 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: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
1-
# replace-ext [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url]
1+
<p align="center">
2+
<a href="http://gulpjs.com">
3+
<img height="257" width="114" src="https://github.com/gulpjs/artwork/master/gulp-2x.png">
4+
</a>
5+
</p>
26

7+
# replace-ext
38

4-
## Information
9+
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![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]
510

6-
<table>
7-
<tr>
8-
<td>Package</td><td>replace-ext</td>
9-
</tr>
10-
<tr>
11-
<td>Description</td>
12-
<td>Replaces a file extension with another one</td>
13-
</tr>
14-
<tr>
15-
<td>Node Version</td>
16-
<td>>= 0.4</td>
17-
</tr>
18-
</table>
11+
Replaces a file extension with another one.
1912

2013
## Usage
2114

22-
```javascript
15+
```js
2316
var replaceExt = require('replace-ext');
2417

2518
var path = '/some/dir/file.js';
26-
var npath = replaceExt(path, '.coffee');
19+
var newPath = replaceExt(path, '.coffee');
2720

28-
console.log(npath); // /some/dir/file.coffee
21+
console.log(newPath); // /some/dir/file.coffee
2922
```
3023

31-
[npm-url]: https://npmjs.org/package/replace-ext
32-
[npm-image]: https://badge.fury.io/js/replace-ext.png
24+
## API
3325

34-
[travis-url]: https://travis-ci.org/wearefractal/replace-ext
35-
[travis-image]: https://travis-ci.org/wearefractal/replace-ext.png?branch=master
26+
### `replaceExt(path, extension)`
3627

37-
[coveralls-url]: https://coveralls.io/r/wearefractal/replace-ext
38-
[coveralls-image]: https://coveralls.io/repos/wearefractal/replace-ext/badge.png
28+
Replaces the extension from `path` with `extension` and returns the updated path string.
3929

40-
[depstat-url]: https://david-dm.org/wearefractal/replace-ext
41-
[depstat-image]: https://david-dm.org/wearefractal/replace-ext.png
30+
Does not replace the extension if `path` is not a string or is empty.
4231

43-
[david-url]: https://david-dm.org/wearefractal/replace-ext
44-
[david-image]: https://david-dm.org/wearefractal/replace-ext.png?theme=shields.io
32+
## License
33+
34+
MIT
35+
36+
[downloads-image]: http://img.shields.io/npm/dm/replace-ext.svg
37+
[npm-url]: https://www.npmjs.com/package/replace-ext
38+
[npm-image]: http://img.shields.io/npm/v/replace-ext.svg
39+
40+
[travis-url]: https://travis-ci.org/gulpjs/replace-ext
41+
[travis-image]: http://img.shields.io/travis/gulpjs/replace-ext.svg?label=travis-ci
42+
43+
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/replace-ext
44+
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/replace-ext.svg?label=appveyor
45+
46+
[coveralls-url]: https://coveralls.io/r/gulpjs/replace-ext
47+
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/replace-ext/master.svg
48+
49+
[gitter-url]: https://gitter.im/gulpjs/gulp
50+
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg

appveyor.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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: "5"
11+
- nodejs_version: "6"
12+
13+
install:
14+
- ps: Install-Product node $env:nodejs_version
15+
- npm install
16+
17+
test_script:
18+
- node --version
19+
- npm --version
20+
- cmd: npm test
21+
22+
build: off
23+
24+
# build version format
25+
version: "{build}"

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
'use strict';
2+
13
var path = require('path');
24

3-
module.exports = function(npath, ext) {
5+
function replaceExt(npath, ext) {
46
if (typeof npath !== 'string') {
57
return npath;
68
}
@@ -11,4 +13,6 @@ module.exports = function(npath, ext) {
1113

1214
var nFileName = path.basename(npath, path.extname(npath)) + ext;
1315
return path.join(path.dirname(npath), nFileName);
14-
};
16+
}
17+
18+
module.exports = replaceExt;

package.json

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
{
22
"name": "replace-ext",
3-
"description": "Replaces a file extension with another one",
43
"version": "0.0.1",
5-
"homepage": "http://github.com/wearefractal/replace-ext",
6-
"repository": "git://github.com/wearefractal/replace-ext.git",
7-
"author": "Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
8-
"main": "./index.js",
4+
"description": "Replaces a file extension with another one",
5+
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
6+
"contributors": [
7+
"Eric Schoffstall <yo@contra.io>",
8+
"Blaine Bublitz <blaine.bublitz@gmail.com>"
9+
],
10+
"repository": "gulpjs/replace-ext",
11+
"license": "MIT",
12+
"engines": {
13+
"node": ">= 0.10"
14+
},
15+
"main": "index.js",
16+
"files": [
17+
"LICENSE",
18+
"index.js"
19+
],
20+
"scripts": {
21+
"lint": "eslint . && jscs index.js test/",
22+
"pretest": "npm run lint",
23+
"test": "mocha --async-only",
24+
"cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly",
25+
"coveralls": "npm run cover && istanbul-coveralls"
26+
},
927
"dependencies": {},
1028
"devDependencies": {
1129
"eslint": "^1.10.3",
@@ -17,20 +35,10 @@
1735
"jscs-preset-gulp": "^1.0.0",
1836
"mocha": "^2.4.5"
1937
},
20-
"scripts": {
21-
"lint": "eslint . && jscs index.js test/",
22-
"pretest": "npm run lint",
23-
"test": "mocha --async-only",
24-
"cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly",
25-
"coveralls": "npm run cover && istanbul-coveralls"
26-
},
27-
"engines": {
28-
"node": ">= 0.4"
29-
},
30-
"licenses": [
31-
{
32-
"type": "MIT",
33-
"url": "http://github.com/wearefractal/replace-ext/raw/master/LICENSE"
34-
}
38+
"keywords": [
39+
"gulp",
40+
"extensions",
41+
"filepath",
42+
"basename"
3543
]
3644
}

test/.eslintrc

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

0 commit comments

Comments
 (0)