Skip to content

Commit

Permalink
Add conditional exports data to the package
Browse files Browse the repository at this point in the history
This allows Node users to import the modular code straight from
"fluture", as opposed to having to deep import from "fluture/index.js".
  • Loading branch information
Avaq committed Aug 11, 2020
1 parent 0ae92d9 commit 42c204c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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 42c204c

Please sign in to comment.