Socket
Socket
Sign inDemoInstall

@hyperledger/aries-askar-shared

Package Overview
Dependencies
3
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @hyperledger/aries-askar-shared

Shared library for using Aries Askar with NodeJS and React Native


Version published
Weekly downloads
1.2K
decreased by-10.82%
Maintainers
3
Install size
220 kB
Created
Weekly downloads
 

Readme

Source

Aries Askar Shared

This package does not contain any functionality, just the classes and types that wrap around the native NodeJS / React Native functionality

Platform independent setup

If you would like to leverage the Aries Askar libraries for JavaScript in a platform independent way you need to add the @hyperledger/aries-askar-shared package to your project. This package exports all public methods.

Before calling any methods you then need to make sure you register the platform specific native bindings. You can do this by importing the platform specific package. You can do this by having separate files that register the package, which allows the React Native bundler to import a different package:

// register.ts
import '@hyperledger/aries-askar-nodejs'
// register.native.ts
import '@hyperledger/aries-askar-react-native'

An alterative approach is to first try to require the Node.JS package, and otherwise require the React Native package:

try {
  require('@hyperledger/aries-askar-nodejs')
} catch (error) {
  try {
    require('@hyperledger/aries-askar-react-native')
  } catch (error) {
    throw new Error('Could not load Aries Askar bindings')
  }
}

How you approach it is up to you, as long as the native binding are called before any actions are performed on the Aries Askar library.

Version Compatibility

The JavaScript wrapper is versioned independently from the native bindings. The following table shows the compatibility between the different versions:

Aries AskarJavaScript Wrapper
v0.2.9v0.1.0, v0.1.1
v0.3.1v0.2.0

FAQs

Last updated on 10 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc