Skip to content

Commit 1a760de

Browse files
committed
meta tweaks
1 parent 499d841 commit 1a760de

File tree

6 files changed

+21
-27
lines changed

6 files changed

+21
-27
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ insert_final_newline = true
1010
[{package.json,*.yml}]
1111
indent_style = space
1212
indent_size = 2
13-
14-
[*.md]
15-
trim_trailing_whitespace = false

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: node_js
2-
32
node_js:
4-
- 'stable'
3+
- '6'
4+
- '5'
5+
- '4'
56
- '0.12'
67
- '0.10'
7-
88
after_script:
99
- 'cat ./coverage/lcov.info | ./node_modules/.bin/coveralls'

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ function install(precompile, ext, extensions) {
99

1010
extensions[ext] = function (module, filename) {
1111
var source = precompile(filename);
12+
1213
if (source) {
1314
module._compile(source, filename);
1415
return;
1516
}
17+
1618
oldExtension(module, filename);
1719
};
1820
}

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"description": "Require extension that allows for caching/precompiling",
55
"license": "MIT",
6-
"repository": "jamestalmage/require-precompiled",
6+
"repository": "avajs/require-precompiled",
77
"author": {
88
"name": "James Talmage",
99
"email": "[email protected]",
@@ -24,17 +24,11 @@
2424
"cache",
2525
"precompile"
2626
],
27-
"dependencies": {},
2827
"devDependencies": {
2928
"ava": "^0.14.0",
3029
"coveralls": "^2.11.6",
3130
"fake-module-system": "^0.3.0",
3231
"nyc": "^6.2.1",
33-
"xo": "^0.13.0"
34-
},
35-
"xo": {
36-
"ignores": [
37-
"test.js"
38-
]
32+
"xo": "^0.15.1"
3933
}
4034
}

readme.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# require-precompiled [![Build Status](https://travis-ci.org/jamestalmage/require-precompiled.svg?branch=master)](https://travis-ci.org/jamestalmage/require-precompiled) [![Coverage Status](https://coveralls.io/repos/jamestalmage/require-precompiled/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/require-precompiled?branch=master)
1+
# require-precompiled [![Build Status](https://travis-ci.org/avajs/require-precompiled.svg?branch=master)](https://travis-ci.org/avajs/require-precompiled) [![Coverage Status](https://coveralls.io/repos/github/avajs/require-precompiled/badge.svg?branch=master)](https://coveralls.io/github/avajs/require-precompiled?branch=master)
22

3-
> Require extension that allows for caching/precompiling
3+
> Require extension that allows for caching/precompiling
44
55

66
## Install
@@ -17,14 +17,14 @@ const installPrecompiler = require('require-precompiled');
1717
const cache = require('my-cache-implementation');
1818

1919
installPrecompiler(filename => {
20-
if (cache.hasEntryFor(filename)) {
21-
return cache.getPrecompiledCode(filename);
22-
}
23-
// fall through to underlying extension chain;
24-
return null;
20+
if (cache.hasEntryFor(filename)) {
21+
return cache.getPrecompiledCode(filename);
22+
}
23+
// fall through to underlying extension chain
24+
return null;
2525
});
2626

27-
// Any module required from this point on will be checked against the cache.
27+
// any module required from this point on will be checked against the cache
2828
const foo = require('some-module');
2929
```
3030

@@ -42,4 +42,4 @@ Return `string` contents for a cache hit, or `null` for a miss.
4242

4343
## License
4444

45-
MIT © [James Talmage](http://github.com/jamestalmage)
45+
MIT © [James Talmage](https://github.com/jamestalmage)

test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import path from 'path';
12
import test from 'ava';
2-
import install from './';
33
import System from 'fake-module-system';
4-
import path from 'path';
4+
import install from './';
55

66
test('module is compiled with source returned from precompiler', t => {
77
const system = new System({
@@ -35,7 +35,7 @@ test('passes through to underlying extension precompiler returns undefined', t =
3535
t.is(module.file, '/foo.js');
3636
});
3737

38-
test('allows extensions beyond ".js"', t => {
38+
test('allows extensions beyond `.js`', t => {
3939
const system = new System({
4040
'/foo.coffee': 'coffee foo'
4141
});
@@ -52,12 +52,13 @@ test('allows extensions beyond ".js"', t => {
5252
});
5353

5454
test('test actual require', t => {
55-
var fixtureFile = path.join(__dirname, 'fixture.js');
55+
const fixtureFile = path.join(__dirname, 'fixture.js');
5656

5757
install(filename => {
5858
if (filename === fixtureFile) {
5959
return 'module.exports = "foobar"';
6060
}
61+
6162
return null;
6263
});
6364

0 commit comments

Comments
 (0)