This repository was archived by the owner on Dec 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ LevelUP
20
20
* <a href =" #basic " >Basic usage</a >
21
21
* <a href =" #api " >API</a >
22
22
* <a href =" #promises " >Promise Support</a >
23
+ * <a href =" #import " >Import with Type Definitions</a >
23
24
* <a href =" #events " >Events</a >
24
25
* <a href =" #extending " >Extending LevelUP</a >
25
26
* <a href =" #multiproc " >Multi-process access</a >
@@ -452,6 +453,26 @@ const main = async () {
452
453
453
454
--------------------------------------------------------
454
455
456
+ <a name =" import " ></a >
457
+ ES6 Import
458
+ ----------
459
+
460
+ We have two ways to import(require) the levelup module in the code.
461
+
462
+ ### 1. By using ` require `
463
+
464
+ ``` js
465
+ var levelup = require (' levelup' )
466
+ ```
467
+
468
+ ### 2. By using ES6 ` import `
469
+
470
+ ``` js
471
+ import levelup from ' levelup'
472
+ ```
473
+
474
+ --------------------------------------------------------
475
+
455
476
<a name =" events " ></a >
456
477
Events
457
478
------
Original file line number Diff line number Diff line change @@ -291,4 +291,4 @@ function maybeError (db, callback) {
291
291
}
292
292
293
293
LevelUP . errors = errors
294
- module . exports = LevelUP
294
+ module . exports = LevelUP . default = LevelUP
You can’t perform that action at this time.
0 commit comments