accent

    0.0.9 • Public • Published

    accent

    A simple library for serializable highlights.

    import Accent from 'accent';
     
    const accent = new Accent();
     
    accent.highlightCurrentSelection()
      .then(highlight => {
        highlight.scrollIntoView();
      }).catch(err => {
        console.log('Oh no!');
      });
     
    /* or */
     
    accent.highlightFromString('Hello, world!')
      .then(highlight => {
        highlight.scrollIntoView();
      }).catch(err => {
        console.log('Oh no!');
      });

    Installation

    npm install accent --save
    

    Usage

    Bundle with browserify if you're building a project with node.

    Or, if making a static website, paste this line of HTML into your code:

    <script src="https://www.brcdn.org/accent/latest/?standalone=Accent"></script>

    Accent will be available in the global scope.

    License

    MIT

    Install

    npm i accent

    DownloadsWeekly Downloads

    4

    Version

    0.0.9

    License

    MIT

    Last publish

    Collaborators

    • migueloller