Skip to content

Commit

Permalink
Merge pull request #48 from Nesopie/feat/hybrid
Browse files Browse the repository at this point in the history
feat: hybrid cjs and esm support
  • Loading branch information
junderw authored Jun 24, 2024
2 parents 3ebc63d + 0fd6d48 commit f20339e
Show file tree
Hide file tree
Showing 15 changed files with 4,743 additions and 43 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.d.ts
28 changes: 19 additions & 9 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,30 @@ jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 12
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm ci
- run: npm run unit
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 12
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm run standard
- run: npm ci
- run: npm run standard
gitdiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run gitdiff
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
.DS_Store
coverage/
package-lock.json
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ API
**example**:

```js
const bs58 = require('bs58')
import bs58 from 'bs58'

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

```js
const bs58 = require('bs58')
import bs58 from 'bs58'

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

```bash
browserify node_modules/bs58/index.js -o bs58.bundle.js --standalone bs58
browserify node_modules/bs58/cjs/index.cjs -o bs58.bundle.js --standalone bs58
```

Hack / Test
Expand Down
5 changes: 0 additions & 5 deletions index.d.ts

This file was deleted.

Loading

0 comments on commit f20339e

Please sign in to comment.