Package Exports
- jwk-lite
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jwk-lite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jwk-lite
Install
npm install jwk-lite
Usage
const jwk = require('jwk-lite')
jwk.generateKey('HS256')
.then(keys => {
console.log(keys.sharedKey)
})
jwk.generateKey('PS256')
.then(keys => {
console.log(keys.publicKey)
console.log(keys.privateKey)
})
jwk.generateKey('RS256')
.then(keys => {
console.log(keys.publicKey)
console.log(keys.privateKey)
})
jwk.generateKey('ES256')
.then(keys => {
console.log(keys.publicKey)
console.log(keys.privateKey)
})
jwk.exportKey(key)
.then(jsonJwk => console.log(jsonJwk))
jwk.import(jsonJwk)
.then(key => console.log(key))Can it be smaller?
If you use ES6 imports with a bundler that supports tree-shaking, yes!
import { generateKey } from 'jwk-lite'License
MIT