lil5 / simple-cryptor-pouch

pouchdb AES encryption using brix/crypto-js
MIT License
8 stars 1 forks source link

simple cryptor pouch and Vue #1

Open adamprocter opened 3 years ago

adamprocter commented 3 years ago

Version

Description

I am looking to use basic encryption of my poucdb so the data is encrypted on couchdb in a vue app None of the solutions seem that up to date and I like the simplicity your plugin seems to offer

However I am not sure how to use it within vue app, I assumed I could use it like so

import PouchDB from 'pouchdb'
import SimpleCryptor from 'simple-cryptor-pouch'

var pouchdb = new PouchDB(microcosm)
pouchdb.SimpleCryptor('password') 

But i get the warning 'SimpleCryptor' is defined but never used so I have tried defining as a plugin

Vue.use(SimpleCryptor)

But get this error... maybe library is not up to date ?

ENOENT: no such file or directory, open 'app/node_modules/transform-pouch/node_modules/lie/lib/index.js'

Any tips / thoughts very much appreciated

lil5 commented 3 years ago

As this is not a Vue plugin'Vue.use' will not work.

It looks like you have glossed over this line from the examples


PouchDB.plugin(SimpleCryptor)
adamprocter commented 3 years ago

Thanks, I think I tried this before. Anyway had another go and just get the error pouchdb.SimpleCryptor is not a function