> For the complete documentation index, see [llms.txt](https://stash-it.gitbook.io/stash-it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stash-it.gitbook.io/stash-it/api.md).

# API

- [stash-it](https://stash-it.gitbook.io/stash-it/api/stash-it.md)
- [createCache(adapter)](https://stash-it.gitbook.io/stash-it/api/stash-it/createcache-adapter.md): Creates a cache instance.
- [createItem(key, value, \[extra\])](https://stash-it.gitbook.io/stash-it/api/stash-it/createitem-key-value-extra.md): Creates an item.
- [getPreData(methodName, args)](https://stash-it.gitbook.io/stash-it/api/stash-it/getpredata-methodname-args.md): Returns \`pre\` (in terms of lifecycle of given method) data which is passed through all of the hooks registered for that particular method.
- [getPostData(methodName, args)](https://stash-it.gitbook.io/stash-it/api/stash-it/getpostdata-methodname-args.md): Returns \`post\` (in terms of lifecycle of given method) data which is passed through all of the hooks registered for that particular method.
- [cacheInstance](https://stash-it.gitbook.io/stash-it/api/cacheinstance.md)
- [addHook(hook)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/addhook-hook.md): Adds a hook.
- [addHooks(hooks)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/addhooks-hooks.md): Adds hooks.
- [getHooks()](https://stash-it.gitbook.io/stash-it/api/cacheinstance/gethooks.md): Returns hooks.
- [buildKey(key)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/buildkey-key.md): Builds a key.
- [getItem(key)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/getitem-key.md): Returns an item.
- [getExtra(key)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/getextra-key.md): Returns extra (for given object for given key).
- [addExtra(key, extra)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/addextra-key-extra.md): Adds extra to item's existing extra. New properties are added, existing are overwritten.
- [setExtra(key, extra)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/setextra-key-extra.md): Sets (replaces whole existing) extra in an item.
- [setItem(key, value, \[extra\])](https://stash-it.gitbook.io/stash-it/api/cacheinstance/setitem-key-value-extra.md): Sets an item (and returns it, once created).
- [hasItem(key)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/hasitem-key.md): Checks if item exists.
- [removeItem(key)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/removeitem-key.md): Removes an item.
- [registerPlugins(plugins)](https://stash-it.gitbook.io/stash-it/api/cacheinstance/registerplugins-plugins.md): Registers plugins and returns new instance of self (cacheInstance) extended with functionalities provided by plugins.
- [Adapter](https://stash-it.gitbook.io/stash-it/api/adapter.md)
- [buildKey(key)](https://stash-it.gitbook.io/stash-it/api/adapter/buildkey-key.md): Builds a key.
- [getItem(key)](https://stash-it.gitbook.io/stash-it/api/adapter/getitem-key.md): Returns an item.
- [getExtra(key)](https://stash-it.gitbook.io/stash-it/api/adapter/getextra-key.md): Returns and extra.
- [addExtra(key, extra)](https://stash-it.gitbook.io/stash-it/api/adapter/addextra-key-extra.md): Adds extra to given item.
- [setExtra(key, extra)](https://stash-it.gitbook.io/stash-it/api/adapter/setextra-key-extra.md): Sets (replaces existing) extra.
- [setItem(key, value, \[extra\])](https://stash-it.gitbook.io/stash-it/api/adapter/setitem-key-value-extra.md): This method sets an item and returns it as well.
- [hasItem(key)](https://stash-it.gitbook.io/stash-it/api/adapter/hasitem-key.md): Checks if items exists.
- [removeItem(key)](https://stash-it.gitbook.io/stash-it/api/adapter/removeitem-key.md): Removes an item.
