0.3.2 • Published 2 years ago

expo-level v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

expo-level

abstract-level adapter for react-native-leveldb

Installation

npm install expo-level

Install expo

Because the project use expo-file-system, you also need configure Expo if you use this in a bare React Native Projects.

See: https://www.npmjs.com/package/expo-file-system

Polyfill

The project requires some polyfill, either. You need to configure manually:

TextEncoder object

You need to manually setup a polyfill for TextEncoder. There are multiple ways to do this, one of the way is:

npm install react-native-polyfill-globals

And then include this in your project:

import 'react-native-polyfill-globals/auto'

Nodejs library

Include this in your project:

You may need install buffer@6 first

if (!global.process.cwd) {
  global.process.cwd = () => {
    return '.';
  }
}
if (!(global as any).__dirname) {
  (global as any).__dirname = '.';
}
if (!(global as any).Buffer) {
  global.Buffer = require('buffer').Buffer;
}

Usage

import {SKReactNativeLevel} from "expo-level";

const db = new SKReactNativeLevel("test", {/* options */})

// ...

Issues

Passes nearly all tests of abstract-level except for "async-iterator-test.js".

This issue may be due to the metro bundler, see

To run tests, start up the testapp app and click "Start Test".

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Thanks To

License

MIT

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago