Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hybrid cjs and esm support #48

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading