Skip to content

Feature/esmbuild #71

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,31 @@ ASN1.js V2 (ES2015 version) is **incompatible** with ASN1.js V1 code.
* All types can be initialized in static or dynamic ways.
* [ASN1js][] fully tested against [ASN.1:2008 TestSuite][].

## Installation

### Node

`npm install --save asn1js`

```javascript
// ESM
import { fromBER, /* ... */ } from "asn1js";

// CommonJS
const asn1js = require("asn1js");
```

### Browser

Import one of the following files using cdn or manual inclusion

* `src/asn1.js`: ESM with remote dependency of pvutils
* `build/asn1.bundle.mjs`: ESM with bundled pvutils

### Deno

Import `build/asn1.bundle.mjs` using you favorite method

## Examples

```javascript
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"babel-plugin-istanbul": "latest",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"asn1-test-suite": "latest",
"babel-plugin-istanbul": "latest",
"cross-env": "latest",
"mocha": "latest",
"rollup": "latest",
"nyc": "latest",
"cross-env": "latest",
"rollup-plugin-node-resolve": "latest",
"asn1-test-suite": "latest"
"rollup": "latest",
"rollup-plugin-node-resolve": "latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -62,7 +63,7 @@
"index.d.ts"
],
"scripts": {
"build": "babel src --compact=false --out-dir build --source-maps",
"build": "babel src --compact=false --out-dir build --source-maps && rollup -c ./rollup.config.js",
"watch": "babel src --compact=false --out-dir build --source-maps --watch",
"ex1": "cd examples/ASN1Usage && npm run build && cd ../..",
"build:examples": "npm run ex1",
Expand Down
12 changes: 12 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';

export default [
{
input: "./src/asn1.js",
output: {
file: "build/asn1.bundle.mjs",
format: "es"
},
plugins: [nodeResolve()]
}
];