unravel-me

0.2.2 • Public • Published

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);
}
 
 

Package Sidebar

Install

npm i unravel-me

Weekly Downloads

2

Version

0.2.2

License

ISC

Unpacked Size

3.08 kB

Total Files

4

Last publish

Collaborators

  • heyitsmario