-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b3078e
commit ae4458e
Showing
1 changed file
with
8 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,40 +12,34 @@ This package can be installed with either npm or yarn via the following commands | |
|
||
```sh | ||
npm install @lapo/asn1js | ||
# or with yarn | ||
# or other tools | ||
npm install @lapo/asn1js | ||
yarn add @lapo/asn1js | ||
``` | ||
|
||
Assuming a standard javascript bundler is setup you can import it like so: | ||
|
||
```js | ||
const ASN1 = require('@lapo/asn1js'); | ||
// or with ES modules | ||
import ASN1 from '@lapo/asn1js'; | ||
``` | ||
|
||
A submodule of this package can also be imported: | ||
|
||
```js | ||
const Hex = require('@lapo/asn1js/hex'); | ||
// or with ES modules | ||
import Hex from '@lapo/asn1js/hex'; | ||
``` | ||
|
||
Usage with RequireJS | ||
Usage on the web | ||
-------------------- | ||
|
||
Can be [tested on JSFiddle](https://jsfiddle.net/lapo/tmdq35ug/). | ||
Can be [tested on JSFiddle](https://jsfiddle.net/lapo/y6t2wo7q/). | ||
|
||
```html | ||
<script type="text/javascript" src="https://unpkg.com/requirejs/require.js"></script> | ||
<script> | ||
require([ | ||
'https://unpkg.com/@lapo/asn1js/asn1.js', | ||
'https://unpkg.com/@lapo/asn1js/hex.js' | ||
], function(ASN1, Hex) { | ||
document.body.innerText = ASN1.decode(Hex.decode('06032B6570')).content(); | ||
}); | ||
import { ASN1} from 'https://unpkg.com/@lapo/[email protected]/asn1.js'; | ||
import { Hex } from 'https://unpkg.com/@lapo/[email protected]/hex.js'; | ||
document.body.innerText = ASN1.decode(Hex.decode('06032B6570')).content(); | ||
</script> | ||
``` | ||
|
||
|