Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

num-client

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

num-client - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

web/num-client-0.0.4.js

11

package.json
{
"name": "num-client",
"version": "0.0.4",
"version": "0.0.5",
"description": "A NUM Protocol Client in TypeScript",

@@ -23,2 +23,3 @@ "types": "index.d.ts",

"@types/node": "^14.0.13",
"browserify": "^17.0.0",
"chai": "^4.2.0",

@@ -44,3 +45,4 @@ "mocha": "^8.1.3",

"prepare": "npm test",
"publish": "git push && git push --tags --force"
"publish": "git push && git push --tags --force",
"browserify": "mkdir -p web && browserify -r ./index.js:num-client >web/${npm_package_name}-${npm_package_version}.js"
},

@@ -57,4 +59,5 @@ "author": "NUM Technology Ltd",

"index.d.ts",
"index.js"
"index.js",
"web/*"
]
}
}

@@ -207,1 +207,44 @@ # NUM Client

```
# HTML and JavaScript Example
## The Simplest Usage
This simple example can be modified as necessary by following the previous examples above.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>NUM Protocol Example</title>
</head>
<body>
<script src="../web/num-client-0.0.5.js"></script>
<h1>num.uk:1</h1>
<pre id='num'></pre>
</body>
<script>
window.addEventListener('load', function () {
const num = require('num-client');
function lookup(uri) {
const numUri = num.parseNumUri(uri);
const client = num.createClient();
const ctx = client.createContext(numUri);
return client.retrieveNumRecord(ctx);
}
lookup('num.uk:1').then((result) => {
const pretty = JSON.stringify(JSON.parse(result), null, 4);
document.getElementById('num').innerHTML = pretty;
});
});
</script>
</html>
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc