Skip to content

Commit ffc3b30

Browse files
committed
Use read-cache to cache file reads for performance
1 parent 4e82b21 commit ffc3b30

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const path = require('path')
55

66
const ora = require('ora')
77
const stdin = require('get-stdin')
8+
const read = require('read-cache')
89
const chalk = require('chalk')
910
const globber = require('globby')
1011
const chokidar = require('chokidar')
@@ -237,7 +238,7 @@ function files (files) {
237238
})
238239
}
239240

240-
return fs.readFile(file)
241+
return read(file)
241242
.then((content) => css(content, file))
242243
}))
243244
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"postcss": "^5.2.16",
2626
"postcss-load-config": "^1.1.0",
2727
"postcss-reporter": "^3.0.0",
28+
"read-cache": "^1.0.0",
2829
"yargs": "^7.0.2"
2930
},
3031
"devDependencies": {

0 commit comments

Comments
 (0)