3.5.28 • Published 14 days ago

@leofcoin/storage v3.5.28

Weekly downloads
1
License
MIT
Repository
github
Last release
14 days 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.28

14 days ago

3.5.27

21 days ago

3.5.25

28 days ago

3.5.26

28 days ago

3.5.24

3 months ago

3.5.23

3 months ago

3.5.19

3 months ago

3.5.18

3 months ago

3.5.17

3 months ago

3.5.16

3 months ago

3.5.22

3 months ago

3.5.21

3 months ago

3.5.20

3 months ago

3.5.15

3 months ago

3.5.14

3 months ago

3.5.13

3 months ago

3.5.12

3 months ago

3.5.11

4 months ago

3.5.10

5 months ago

3.5.7

7 months ago

3.5.6

7 months ago

3.5.5

7 months ago

3.5.4

9 months ago

3.5.9

6 months ago

3.5.8

7 months ago

3.5.3

9 months ago

3.5.2

11 months ago

3.5.1

1 year ago

3.5.0

1 year ago

3.3.2

1 year ago

3.3.1

1 year ago

3.2.2

1 year ago

3.3.0

1 year ago

3.2.1

1 year ago

3.1.2

1 year ago

3.2.0

1 year ago

3.1.1

1 year ago

3.1.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

3.0.9

2 years ago

2.3.1

2 years ago

2.3.0

2 years ago

2.2.1

2 years ago

2.1.2

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago