Class for accessing Fastly Edge Dictionaries.
Note: Can only be used when processing requests, not during build-time initialization.
In this example we have an Edge Dictionary named 'animals' and we return the 'cat' entry as the response body to the client.
async function app (event) { const animals = new Dictionary('animals'); return new Response(animals.get('cat')); }
addEventListener("fetch", event => event.respondWith(app(event)));
```
Creates a new Dictionary object, and opens an edge dictionary to query
Throws an Error if no Dictionary exists with the provided name
Error
Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns null.
null
Throws an TypeError if the provided key is longer than 256 characters.
TypeError
Generated using TypeDoc
Class for accessing Fastly Edge Dictionaries.
Note: Can only be used when processing requests, not during build-time initialization.
Example
In this example we have an Edge Dictionary named 'animals' and we return the 'cat' entry as the response body to the client.