Skip to content

Commit

Permalink
feat: Only export as ESM.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Aug 24, 2021
1 parent 092faed commit 4b9f795
Show file tree
Hide file tree
Showing 31 changed files with 142 additions and 703 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Use Node.js LTS
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: lts/*
- name: Restore cached dependencies
uses: actions/cache@v2
with:
Expand Down
15 changes: 3 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
package-lock.json
yarn.lock

.nyc_output
coverage/
node_modules/
tmp/

npm-debug.log
npm-error.log
yarn-debug.log
yarn-error.log
dist/
types/
coverage/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If `callback` is not provided, the method returns a `Promise`.
## Example

```js
const { info } = require('fastimage')
import { info } from 'fastimage'

info('http://fakeimg.pl/1000x1000/', (error, data) => {
if (error) {
Expand All @@ -49,7 +49,7 @@ info('http://fakeimg.pl/1000x1000/', (error, data) => {
}
})

const data = await fastimage('http://fakeimg.pl/1000x1000/')
const data = await info('http://fakeimg.pl/1000x1000/')
```

The callback argument (or the resolved value) will be an object with the following properties:
Expand All @@ -73,7 +73,8 @@ Calling `fastimage.stream` it will return a Writable stream which will emit the
The stream accepts only the `threshold` option.

```js
const { info } = require('fastimage')
import { stream } from 'fastimage'

const pipe = createReadStream('/path/to/image.png').pipe(stream({ threshold: 100 }))

pipe.on('info', data => {
Expand Down
23 changes: 0 additions & 23 deletions dist/cjs/callback.js

This file was deleted.

59 changes: 0 additions & 59 deletions dist/cjs/index.js

This file was deleted.

121 changes: 0 additions & 121 deletions dist/cjs/internals.js

This file was deleted.

20 changes: 0 additions & 20 deletions dist/cjs/models.js

This file was deleted.

48 changes: 0 additions & 48 deletions dist/cjs/stream.js

This file was deleted.

19 changes: 0 additions & 19 deletions dist/mjs/callback.mjs

This file was deleted.

Loading

0 comments on commit 4b9f795

Please sign in to comment.