Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #494 from zixia/master
Browse files Browse the repository at this point in the history
add default export
  • Loading branch information
ralphtheninja authored Sep 26, 2017
2 parents 091cd95 + 586993b commit f93790f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LevelUP
* <a href="#basic">Basic usage</a>
* <a href="#api">API</a>
* <a href="#promises">Promise Support</a>
* <a href="#import">Import with Type Definitions</a>
* <a href="#events">Events</a>
* <a href="#extending">Extending LevelUP</a>
* <a href="#multiproc">Multi-process access</a>
Expand Down Expand Up @@ -452,6 +453,26 @@ const main = async () {

--------------------------------------------------------

<a name="import"></a>
ES6 Import
----------

We have two ways to import(require) the levelup module in the code.

### 1. By using `require`

```js
var levelup = require('levelup')
```

### 2. By using ES6 `import`

```js
import levelup from 'levelup'
```

--------------------------------------------------------

<a name="events"></a>
Events
------
Expand Down
2 changes: 1 addition & 1 deletion lib/levelup.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,4 @@ function maybeError (db, callback) {
}

LevelUP.errors = errors
module.exports = LevelUP
module.exports = LevelUP.default = LevelUP

0 comments on commit f93790f

Please sign in to comment.