0.2.2 • Published 6 years ago

unravel-me v0.2.2

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Unravel-Me

Unravel-Me is a simple text unwrapper, expander or if you prefer--snippets, that expand in real time.

Installation and Usage.

To install simply do

npm install --save unravel-me

To initialize your snippets you must pass a JSON object to it. The key is the desired shortcut and the value is the expanded form.

// This is snippets.json.
{
  .
  .
  .
  "jcd": "Jacaranda",
  "abf": "A quick brown fox jumps over the lazy dog.",
  "ss": "strawberry shortcake",
  "th": "the",
  .
  .
  .
}
import { Unravel } from 'Unravel-Me';
.
.
,
import abbreviation_list from './path/to/your/list/of/abbreviations/snippets.json';

// ***********
// You must initialize the abbreviation map.
// Place in your code where ever you see fit.
// ***********
Unravel.create_abbreviation_map(abbreviation_list);




// ***********
// If you want to pass the event and have unravel take care of the rest then simply
// pass the event function to it.
function your_function_that_handles_the_event(event) {
  Unravel.expand_abbreviation(event);
}
0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago