Gathering detailed insights and metrics for @lapo/asn1js
Gathering detailed insights and metrics for @lapo/asn1js
npm install @lapo/asn1js
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (96.58%)
CSS (1.5%)
HTML (1.14%)
Shell (0.79%)
Total Downloads
1,014,814
Last Day
1,730
Last Week
7,639
Last Month
31,423
Last Year
343,054
595 Stars
516 Commits
162 Forks
25 Watching
15 Branches
7 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.4
Package Id
@lapo/asn1js@2.0.4
Unpacked Size
530.06 kB
Size
61.39 kB
File Count
11
NPM Version
10.2.4
Node Version
21.5.0
Publised On
08 May 2024
Cumulative downloads
Total Downloads
Last day
1.1%
1,730
Compared to previous day
Last week
-1.8%
7,639
Compared to previous week
Last month
2.6%
31,423
Compared to previous month
Last year
-7.5%
343,054
Compared to previous year
5
asn1js is a JavaScript generic ASN.1 parser/decoder that can decode any valid ASN.1 DER or BER structures.
An example page that can decode Base64-encoded (raw base64, PEM armoring and begin-base64
are recognized) or Hex-encoded (or local files with some browsers) is included and can be used both online on the official website or offline (ZIP file).
nodejs
This package can be installed with either npm or yarn via the following commands:
1npm install @lapo/asn1js 2# or other tools 3pnpm install @lapo/asn1js 4yarn add @lapo/asn1js
You can import the classes like this:
1import { ASN1 } from '@lapo/asn1js';
A submodule of this package can also be imported:
1import { Hex } from '@lapo/asn1js/hex.js';
If your code is still not using ES6 Modules (and is using CommonJS) you can require
it normally since NodeJS 22 (with parameter --experimental-require-module
):
1const 2 { ASN1 } = require('@lapo/asn1js'), 3 { Hex } = require('@lapo/asn1js/hex.js'); 4console.log(ASN1.decode(Hex.decode('06032B6570')).content());
On older NodeJS you instead need to use async import
:
1async function main() { 2 const 3 { ASN1 } = await import('@lapo/asn1js'), 4 { Hex } = await import('@lapo/asn1js/hex.js'); 5 console.log(ASN1.decode(Hex.decode('06032B6570')).content()); 6} 7main();
Can be tested on JSFiddle.
1<script> 2import { ASN1 } from 'https://unpkg.com/@lapo/asn1js@2.0.0/asn1.js'; 3import { Hex } from 'https://unpkg.com/@lapo/asn1js@2.0.0/hex.js'; 4 5document.body.innerText = ASN1.decode(Hex.decode('06032B6570')).content(); 6</script>
Since unfortunately ESM modules are not working on file:
protocol due to CORS issues, there is a bundled single-file version working locally. It doesn't work online (due to CSP restrictions about inline content) but can be saved locally and opened in a browser. (known bug: dark mode is currently broken in this mode)
You can dump an ASN.1 structure from the command line using the following command (no need to even install it):
1npx @lapo/asn1js ed25519.cer
ASN.1 JavaScript decoder Copyright (c) 2008-2024 Lapo Luchini lapo@lapo.it
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More