Skip to content

sebastian-paul/storageWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storage-Wrapper

Have an object lowLevelStorage with the following methods:

  • get(key, callback)
  • put(key, value, callback)
  • del(key, callback)

Written a wrapper that exports a promise-based interface, as well as an additional higher level function batchPut.

The sample usage looks like this:

  • const highLevelStorage = wrap(lowLevelStorage)

  • highLevelStorage.put('a ', 1) // returns a Promise

  • highLevelStorage.get('a') // returns a Promise

  • highLevelStorage.del('a') // returns a Promise

  • highLevelStorage.batchPut([{ key: 'a', value: 1 },{ key: 'b', value: 2])

Implemented the wrap function above

&

Written a lowLevelStorage mock, and test

Start app

npm install

npm start

Test app using mocha

npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published