# twilio-functions-storage

> Storage object for Twilio serverless functions.

Latest version **0.1.0** (published 2021-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install twilio-functions-storage
pnpm add twilio-functions-storage
yarn add twilio-functions-storage
bun add twilio-functions-storage
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-11-01 |
| First published | 2021-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Miguel Grinberg |
| Maintainers | miguelgrinberg |
| Keywords | twilio, serverless, functions, storage |

## Links

- npm: https://www.npmjs.com/package/twilio-functions-storage
- Repository: https://github.com/miguelgrinberg/twilio-functions-storage
- Homepage: https://github.com/miguelgrinberg/twilio-functions-storage#readme
- Issues: https://github.com/miguelgrinberg/twilio-functions-storage/issues
- npm.io page: https://npm.io/package/twilio-functions-storage

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2021-11-01

## README

# twilio-functions-storage
Storage object for Twilio serverless functions that is compatible with the Web Storage API.

## Example

```javascript
const Storage = require('twilio-functions-storage');

exports.handler = async function(context, event, callback) {
  // create a storage object
  const storage = Storage(context);

  // get a variable
  const test = storage.getItem('test');

  // set a variable
  storage.setItem('foo', 'bar');

  // delete a variable
  storage.removeItem('old');

  // save() must be called before exiting to preserve changes
  await storage.save();

  callback();
}
```

## Implementation Notes

Internally, this package uses [Environment Variable](https://www.twilio.com/docs/runtime/functions-assets-api/api/variable)
resources to permanently store data. All the variables created by this packaage
begin with the prefix `S_`.

### Limits

The following are the limitations of this implementation:

- Item values cannot be longer than 450 bytes.
- The Twilio Runtime allocate approximately 3KB for environment variable storage.

---
_Source: https://npm.io/package/twilio-functions-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
