node-expo-crypto
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

node-expo-crypto

The package node-expo-crypto provides the same interface of expo-crypto. So Thus, you can implement mocks that work as expected even in the Node environment.

const crypto = require('node-expo-crypto');

const digest = await crypto.digestStringAsync('sha256', 'hello');
console.log(digest); // 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

This package also contains default mocks for Jest testing framework. For details on how to configure, see below.

Install

$ npm install --save-dev node-expo-crypto

Jest configuration

In your Jest configuration.

{
  ...
  "json": {
    "setupFilesAfterEnv": [
      "node-expo-crypto/jest-setup.js"
    ]
  }
}

Dependencies (0)

    Dev Dependencies (16)

    Package Sidebar

    Install

    npm i node-expo-crypto

    Weekly Downloads

    8

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    4.43 kB

    Total Files

    7

    Last publish

    Collaborators

    • takanori_is