3.5.32 • Published 10 months ago

@leofcoin/storage v3.5.32

Weekly downloads
1
License
MIT
Repository
github
Last release
10 months ago

LeofcoinStorage

CodeQL

install

npm i @leofcoin/storage

breaking changes

checkout

Usage

import LeofcoinStorage from '@leofcoin/storage'

const storage = new LeofcoinStorage(name, root)
await storage.init()
// stores/returns a value as uint8Array

await storage.put('hello', 'world')
(await storage.get('hello')).toString() // world
await storage.get() // [{ key: 'hello', value: 'world'}]
await storage.has('hello') // true
await storage.size() // 4
await storage.delete('hello') // bye world

API

options

name: store name root: root directory

new LeofcoinStorage(name, root)

methods

get

key: path/filename returns: Promise()<uint8Array>

storage.get(key)

const all = storage.get()
console.log(all) // [{key,value}]

put

key: path/filename value: path/filename returns: Promise()

storage.put(key, value)

has

key: path/filename returns: Promise()<Boolean>

storage.has(key)

keys

returns: Promise()<Array>

storage.keys()

values

returns: Promise()<Array>

storage.values(limit)

build for browser

rollup

import resolve from '@rollup/plugin-node-resolve'
export default [{
  input: './node_modules/@leofcoin/src/storage.js',
  output: {
    file: 'dist/storage.js',
    format: 'es'
  }
}, {
  input: './node_modules/@leofcoin/src/browser-store.js',
  output: {
    file: 'dist/browser-store.js',
    format: 'es'
  },
  plugins: [
    resolve()
  ]
}]
3.5.32

10 months ago

3.5.31

11 months ago

3.5.29

11 months ago

3.5.30

11 months ago

3.5.28

1 year ago

3.5.27

1 year ago

3.5.25

1 year ago

3.5.26

1 year ago

3.5.24

1 year ago

3.5.23

1 year ago

3.5.19

1 year ago

3.5.18

1 year ago

3.5.17

1 year ago

3.5.16

1 year ago

3.5.22

1 year ago

3.5.21

1 year ago

3.5.20

1 year ago

3.5.15

1 year ago

3.5.14

1 year ago

3.5.13

1 year ago

3.5.12

1 year ago

3.5.11

2 years ago

3.5.10

2 years ago

3.5.7

2 years ago

3.5.6

2 years ago

3.5.5

2 years ago

3.5.4

2 years ago

3.5.9

2 years ago

3.5.8

2 years ago

3.5.3

2 years ago

3.5.2

2 years ago

3.5.1

2 years ago

3.5.0

2 years ago

3.3.2

2 years ago

3.3.1

2 years ago

3.2.2

3 years ago

3.3.0

2 years ago

3.2.1

3 years ago

3.1.2

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.0

3 years ago

3.0.9

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.1

3 years ago

2.1.2

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago