Skip to content

Commit f20339e

Browse files
authored
Merge pull request #48 from Nesopie/feat/hybrid
feat: hybrid cjs and esm support
2 parents 3ebc63d + 0fd6d48 commit f20339e

15 files changed

+4743
-43
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.d.ts

.github/workflows/main_ci.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,30 @@ jobs:
1010
unit:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v1
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 12
16+
node-version: 18
1717
registry-url: https://registry.npmjs.org/
18-
- run: npm i
18+
- run: npm ci
1919
- run: npm run unit
2020
format:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v2
24-
- uses: actions/setup-node@v1
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v4
2525
with:
26-
node-version: 12
26+
node-version: 18
2727
registry-url: https://registry.npmjs.org/
28-
- run: npm i
29-
- run: npm run standard
28+
- run: npm ci
29+
- run: npm run standard
30+
gitdiff:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: 18
37+
registry-url: https://registry.npmjs.org/
38+
- run: npm ci
39+
- run: npm run gitdiff

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
22
.DS_Store
33
coverage/
4-
package-lock.json

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ API
2424
**example**:
2525

2626
```js
27-
const bs58 = require('bs58')
27+
import bs58 from 'bs58'
2828

2929
const bytes = Uint8Array.from([
3030
0, 60, 23, 110, 101, 155, 234,
@@ -45,7 +45,7 @@ console.log(address)
4545
**example**:
4646

4747
```js
48-
const bs58 = require('bs58')
48+
import bs58 from 'bs58'
4949

5050
const address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS'
5151
const bytes = bs58.decode(address)
@@ -65,7 +65,7 @@ npm install -g browserify
6565
then run:
6666

6767
```bash
68-
browserify node_modules/bs58/index.js -o bs58.bundle.js --standalone bs58
68+
browserify node_modules/bs58/cjs/index.cjs -o bs58.bundle.js --standalone bs58
6969
```
7070

7171
Hack / Test

index.d.ts

-5
This file was deleted.

0 commit comments

Comments
 (0)