Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
didjs
is a javascript package that parses and stringifies
Decentralized Identifiers (DIDs).
yarn add didjs
or
<script type="text/javascript" src="./dist/didjs.min.js"></script>
import * as didjs from 'didjs'
const d = didjs.parse('did:example:1234567890/asdf/qwerty')
console.log(d)
The above example parses the input string according to the rules defined in the DID Grammar and prints the following object:
{
id: "1234567890",
idStrings: ["1234567890"],
method: "example",
path: "asdf/qwerty",
pathSegments: ["asdf", "qwerty"]
}
The input string may also be a DID Reference with a DID Fragment:
const d = didjs.parse("did:example:1234567890#keys-1")
console.log(d.fragment)
// Output: keys-1
This package also stringifies DID objects into valid DID strings:
const d = {
method: 'example',
id: '1234567890'
}
console.log(didjs.stringify(d))
// Output: did:example:1234567890
or with a refence with a fragment:
const d = {
method: 'example',
id: '1234567890',
fragment: 'keys-1'
}
console.log(didjs.stringify(d))
// Output: did:example:1234567890#keys-1
To compile the code in this repository, run:
webpack
This repository includes a suite of tests that check for various edge cases within the DID Grammar.
To run the tests, run:
npm run test
This package is licensed under Apache License 2.0.
FAQs
Decentralized Identifiers parser for javascript
The npm package didjs receives a total of 1 weekly downloads. As such, didjs popularity was classified as not popular.
We found that didjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.