Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
"transform-async-to-generator"
]
}
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.coffee
src
spec
.pairs
.travis.yml
Expand Down
38 changes: 0 additions & 38 deletions Gruntfile.coffee

This file was deleted.

16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ Caches the compiled `.less` files as `.css`.
npm install less-cache
```

```coffeescript
LessCache = require 'less-cache'
```javascript
const LessCache = require('less-cache')
const cache = new LessCache({cacheDir: '/tmp/less-cache'})

cache = new LessCache(cacheDir: '/tmp/less-cache')
css = cache.readFileSync('/Users/me/apps/static/styles.less')
// This method returns a {Promise}, but you can avoid waiting on it as it will
// be waited upon automatically when calling `readFile` or `cssForFile` later.
cache.load()
const css1 = await cache.readFile('/Users/me/apps/static/styles.less')

// Similarly to `load`, this method will return a {Promise} and subsequent calls
// to `readFile` or `cssForFile` will automatically wait on it.
cache.setImportPaths(['path-1', 'path-2'])
const css2 = await cache.readFile('/Users/me/apps/static/styles.less')
```
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "less-cache",
"version": "1.0.0",
"description": "Less compile cache",
"main": "./lib/less-cache",
"main": "./lib/less-cache.js",
"scripts": {
"prepublish": "grunt clean lint coffee",
"test": "grunt test"
"test": "mocha test/**/*.test.js --compilers js:babel-register",
"prepublish": "rimraf lib && babel src -d lib"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,14 +33,14 @@
"walkdir": "0.0.11"
},
"devDependencies": {
"fstream": "^1.0.10",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-coffeelint": "0.0.16",
"grunt-contrib-coffee": "^1.0.0",
"grunt-shell": "^1.3.0",
"jasmine-focused": "1.x",
"temp": "^0.8.3",
"tmp": "0.0.28"
"babel-cli": "^6.23.0",
"babel-plugin-transform-async-to-generator": "^6.22.0",
"babel-register": "^6.23.0",
"dedent": "^0.7.0",
"expect.js": "^0.3.1",
"mocha": "^3.2.0",
"rimraf": "^2.6.1",
"sinon": "^1.17.7",
"temp": "^0.8.3"
}
}
Loading