View profile

Key Value Store

Key Value Store
By News from Napkin • Issue #9 • View online

Napkin key-value store
Napkin key-value store
Key Value Store
With Napkin’s built-in key-value store, you can persist data across all your function executions. Simply import the store module to use the API.
Node.js
import { store } from ‘napkin’
await store.put(‘favColor’, ‘blue’)
Python
from napkin import store
print(store.get(‘favColor’))
# output: {‘data’: ‘blue’}
You can store any valid JSON data type using the store module:
  • a string
  • a number
  • an object (JSON object)
  • an array
  • a boolean
  • null
Check out the docs for the full API!
Did you enjoy this issue?
News from Napkin

Product newsletter from the team behind Napkin

If you don't want these updates anymore, please unsubscribe here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue