Skip to content

Commit

Permalink
feat(node): add is-indy-installed command (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoGlastra committed Oct 31, 2021
1 parent e5aedd0 commit e50b821
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions packages/node/bin/is-indy-installed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env node
/* eslint-disable no-console, @typescript-eslint/no-var-requires, no-undef */

const indy = require('indy-sdk')
const { randomUUID } = require('node:crypto')

const uuid = randomUUID()
const id = `test-wallet-id-${uuid}`

indy
.createWallet({ id }, { key: id })
.then(() => indy.deleteWallet({ id }, { key: id }))
.then(() => {
console.log('Libindy was installed correctly')
})
.catch((e) => {
console.log('Libindy was installed correctly, but an error did occur')
console.error(e)
})
6 changes: 5 additions & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"types": "build/index",
"version": "0.0.0",
"files": [
"build"
"build",
"bin"
],
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -16,6 +17,9 @@
"url": "https://github.com/hyperledger/aries-framework-javascript",
"directory": "packages/node"
},
"bin": {
"is-indy-installed": "bin/is-indy-installed.js"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./build",
Expand Down

0 comments on commit e50b821

Please sign in to comment.