limon-prev-next

1.0.1 • Public • Published

limon-prev-next npmjs.com The MIT License

Plugin for limon pluggable lexer that adds prev and next methods.

code climate standard code style travis build status coverage status dependency status

Install

npm i limon-prev-next --save

Usage

For more use-cases see the tests

const limonPrevNext = require('limon-prev-next')

limonPrevNext

Plugin that adds .prev and .next methods, that are available in next plugins only.

  • returns {Function}: Which you should pass to limon's .use method.

Example

var limon = require('limon')
var prevNext = require('limon-prev-next')
 
limon
  .use(prevNext())
  .use(function () {
    return function (ch, i, input) {
      if (ch === '>') {
        console.log(this.prev())     // => '.'
        console.log(this.prev('3'))  // => 'b'
        console.log(this.next(2))    // => 'q'
        console.log(this.next('4'))  // => 'x'
      }
    }
  })
  .tokenize('abc.> qux')

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Package Sidebar

Install

npm i limon-prev-next

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • vanchoy
  • tunnckocore