Skip to content

Commit

Permalink
Merge pull request #439 from fluture-js/avaq/exports
Browse files Browse the repository at this point in the history
Add conditional exports data to the package
  • Loading branch information
Avaq authored Aug 20, 2020
2 parents 23c003c + 54c9750 commit 4efcf6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ single files that come with all of Fluture's dependencies pre-bundled.

Fluture is written as modular JavaScript.

- On Node 13 and up, Fluture can be loaded directly as shown in the example.
- On Node 12, the `--experimental-modules` flag must be provided.
- On Node 14 and up, Fluture can be loaded directly with `import 'fluture'`.
- On Node 13 and lower, Fluture can be loaded directly with `import 'fluture/index.js'`.
- On Node 12, the `--experimental-modules` flag must be provided in addition.
- On Node versions below 12, the [esm loader][esm] can be used. Alternatively,
there is a [CommonJS Module](#commonjs-module) available.
- Modern browsers can run Fluture directly. If you'd like to try this out,
Expand All @@ -82,7 +83,7 @@ Fluture is written as modular JavaScript.

```js
import {readFile} from 'fs'
import {node, encase, chain, map, fork} from 'fluture/index.js'
import {node, encase, chain, map, fork} from 'fluture'

const getPackageName = file => (
node (done => { readFile (file, 'utf8', done) })
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"type": "module",
"types": "index.d.ts",
"module": "index.js",
"exports": {
"require": "./index.cjs",
"import": "./index.js"
},
"files": [
"src",
"index.cjs",
Expand Down

0 comments on commit 4efcf6e

Please sign in to comment.