diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..a296de8 --- /dev/null +++ b/.babelrc @@ -0,0 +1,9 @@ +{ + "presets": [ + "es2015" + ], + "plugins": [ + "transform-es2015-arrow-functions", + "add-module-exports" + ] +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..589c43a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +coverage +dist + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..39807d2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +node_js: + - v5 + - v4 + - '0.12' + - '0.10' +before_install: + - 'npm install codecov.io' +before_script: + - 'npm run lint' +script: + - 'npm run build' +after_script: + - 'npm run codecov' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..27f423c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Stéphane Bachelier (https://github.com/stephanebachelier) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..51d1d05 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ + + +# superapi-cache +[![NPM version][npm-image]][npm-url] +[![Build Status][travis-image]][travis-url] +[![Codecov Status][codecov-image]][codecov-url] + +> Caching module for superapi + +## Install + +```sh +npm install --save superapi-cache +``` + +## Usage + +```js +import superapiCache from "superapi-cache" + +superapiCache() +``` + +## License + +MIT © [Stéphane Bachelier](https://github.com/stephanebachelier) + +[npm-url]: https://npmjs.org/package/superapi-cache +[npm-image]: https://img.shields.io/npm/v/superapi-cache.svg?style=flat + +[travis-url]: https://travis-ci.org/stephanebachelier/superapi-cache +[travis-image]: https://img.shields.io/travis/stephanebachelier/superapi-cache.svg?style=flat + +[codecov-url]: https://codecov.io/github/stephanebachelier/superapi-cache +[codecov-image]: https://img.shields.io/codecov/c/github/stephanebachelier/superapi-cache.svg?style=flat + +[depstat-url]: https://david-dm.org/stephanebachelier/superapi-cache +[depstat-image]: https://david-dm.org/stephanebachelier/superapi-cache.svg?style=flat +[download-badge]: http://img.shields.io/npm/dm/superapi-cache.svg?style=flat + diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..6bc1982 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,6 @@ +'use strict' + +export default awesome => { + return `everything is ${awesome}` +} + diff --git a/package.json b/package.json new file mode 100644 index 0000000..0c7d3c6 --- /dev/null +++ b/package.json @@ -0,0 +1,58 @@ +{ + "name": "superapi-cache", + "version": "0.0.0", + "description": "Caching module for superapi", + "homepage": "https://github.com/stephanebachelier/superapi-cache", + "author": { + "name": "Stéphane Bachelier", + "email": "stephane.bachelier@gmail.com", + "url": "https://github.com/stephanebachelier" + }, + "files": [ + "/dist", + "/lib" + ], + "main": "dist/index.js", + "jsnext:main": "lib/index.js", + "keywords": [ + "superapi", + "cache", + "xhr", + "request" + ], + "standard": { + "ignore": [ + "/dist" + ] + }, + "scripts": { + "clean": "rimraf dist", + "lint": "standard", + "codecov": "npm run test:coverage -s && codecov < coverage/lcov.info", + "test": "babel-tape-runner test/**.js | tap-spec", + "test:coverage": "babel-node node_modules/.bin/isparta cover test/", + "test:watch": "watch 'npm test' test lib", + "prebuild": "npm run clean -s", + "build": "babel lib --out-dir dist", + "build:watch": "watch 'npm run build' lib", + "preversion": "npm run lint -s && npm run test -s && npm run build -s", + "postversion": "git push origin master --follow-tags", + "deploy": "git pull --rebase origin master && git push origin master" + }, + "repository": "https://github.com/stephanebachelier/superapi-cache", + "license": "MIT", + "devDependencies": { + "babel-cli": "^6.3.17", + "babel-core": "^6.3.26", + "babel-plugin-add-module-exports": "^0.1.2", + "babel-plugin-transform-es2015-arrow-functions": "^6.3.13", + "babel-preset-es2015": "^6.3.13", + "babel-tape-runner": "^2.0.0", + "isparta": "^4.0.0", + "rimraf": "^2.5.0", + "standard": "^5.4.1", + "tap-spec": "^4.1.1", + "tape": "^4.3.0", + "watch": "^0.17.1" + } +} diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..14ee288 --- /dev/null +++ b/test/index.js @@ -0,0 +1,11 @@ +'use strict' + +import superapiCache from '../lib/index.js' +import test from 'tape' + +test('awesome:test', t => { + const message = 'everything is awesome' + t.equals(superapiCache('awesome'), message, message) + t.end() +}) +