Skip to content

Commit

Permalink
Merge pull request #1 from commenthol/devel
Browse files Browse the repository at this point in the history
break: esm module
  • Loading branch information
commenthol committed Sep 14, 2021
2 parents d6701a7 + 3229297 commit 66d5d96
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 320 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tmp/
yarn.lock
package-lock.json
.coveralls.yml
lib/
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ cache:
- "node_modules"

node_js:
- 8
- 10
#- 12
- 12
- 14
- node

script:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> "Least Recently Used" (LRU) cache compatible to ES6 Map
[![NPM version](https://badge.fury.io/js/map-lru.svg)](https://www.npmjs.com/package/map-lru/)
[![Build Status](https://travis-ci.org/commenthol/map-lru.svg?branch=master)](https://travis-ci.org/commenthol/map-lru)
[![Build Status](https://app.travis-ci.com/commenthol/map-lru.svg?branch=master)](https://app.travis-ci.com/commenthol/map-lru)
[![Coverage Status](https://coveralls.io/repos/github/commenthol/map-lru/badge.svg?branch=master)](https://coveralls.io/github/commenthol/map-lru?branch=master)

Useful for caching with limited memory usage.
Expand All @@ -19,7 +19,7 @@ $ npm install map-lru

```js
import MapLRU from 'map-lru' // ES5
// const MapLRU = require('map-lru').default // commonJs
// const MapLRU = require('map-lru') // commonJs
const cache = new MapLRU(10)

cache.set('', '♥♥♥')
Expand Down
253 changes: 0 additions & 253 deletions index.js

This file was deleted.

50 changes: 29 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "map-lru",
"version": "1.1.0",
"version": "2.0.0-0",
"description": "\"Least Recently Used\" (LRU) cache compatible to ES6 Map",
"keywords": [
"cache",
Expand All @@ -16,44 +16,52 @@
"bugs": {
"url": "https://github.com/commenthol/map-lru/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/commenthol/map-lru.git"
},
"license": "Unlicense",
"author": "commenthol <commenthol@gmail.com>",
"main": "index.js",
"module": "index.es.js",
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./lib/index.cjs"
}
},
"main": "lib/index.cjs",
"module": "src/index.js",
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/commenthol/map-lru.git"
},
"scripts": {
"all": "npm run lint && npm run build && npm run test",
"build": "babel -o index.js index.es.js",
"build": "rollup -c",
"clean": "rimraf index.js coverage .nyc_output node_modules",
"coverage": "nyc -r text -r html mocha",
"coveralls": "npm test && nyc report --reporter=text-lcov | coveralls",
"coverage": "c8 -r text -r html mocha",
"coveralls": "npm test && c8 report --reporter=text-lcov | coveralls",
"lint": "standard -v --fix **/*.js",
"prepublishOnly": "npm run build",
"test": "nyc -r text mocha"
"test": "c8 -r text mocha"
},
"babel": {
"presets": [
"env"
]
},
"dependencies": {},
"mocha": {
"checkLeaks": true,
"color": true
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"coveralls": "^3.0.2",
"mocha": "^5.2.0",
"nyc": "^12.0.2",
"standard": "^13.1.0"
"c8": "^7.9.0",
"coveralls": "^3.1.0",
"mocha": "^8.2.1",
"rollup": "^2.56.3",
"standard": "^16.0.3"
},
"engines": {
"node": ">=4"
"node": ">=12"
}
}
13 changes: 13 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default {
input: [
'./src/index.js'
],
output: {
dir: 'lib',
format: 'cjs',
entryFileNames: '[name].cjs',
exports: 'default',
preserveModules: false,
preserveModulesRoot: 'src'
}
}
Loading

0 comments on commit 66d5d96

Please sign in to comment.