An open API service indexing awesome lists of open source software.

https://github.com/localforage/localforage-typescript-plugin-boilerplate

A simple typescript plugin boilerplate for localForage.
https://github.com/localforage/localforage-typescript-plugin-boilerplate

Last synced: over 1 year ago
JSON representation

A simple typescript plugin boilerplate for localForage.

Awesome Lists containing this project

README

          

localForage-typescript-plugin-boilerplate
==============================
[![Build Status](https://travis-ci.org/localForage/localForage-typescript-plugin-boilerplate.svg?branch=master)](https://travis-ci.org/localForage/localForage-typescript-plugin-boilerplate)
[![npm](https://img.shields.io/npm/dm/localforage-typescript-plugin-boilerplate.svg)](https://www.npmjs.com/package/localforage-typescript-plugin-boilerplate)

A simple TypeScript plugin boilerplate for [localForage](https://github.com/mozilla/localForage).

## Requirements

* [localForage](https://github.com/mozilla/localForage) v1.5.0+

## Installation
`npm i localforage-typescript-plugin-boilerplate`

## API
The boilerplate makes the dummy `pluginMethod()` available to all localforage instances.
```js
localforage.pluginMethod().then(function(result) {
console.log(result);
});
```

## Create your plugin

* Rename the occurrences of `pluginMethod`, `localforagePluginBoilerplate` and `_pluginPrivateVariables` in the `lib/localforage-typescript-plugin-boilerplate.js` (and the file itself) to something more appropriate for your plugin.
* Change the respective names in:
* `README.md`
* `package.json`
* `rollup.config.es6.js`
* `rollup.config.umd.js`
* Provide a simple example in the `examples/index.html`