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!