line-counter
Version:
A simple class that allows to count lines while iterating over a string
40 lines (21 loc) • 944 B
Markdown
> {%= description %}
This module helps you when you want to output the line-number of certain locations in a string while iterating over the string otherwise.
For example, if you want to
Suppose, we want to extract all occurences of 'sed' and 'ipsum' from the following text:
{%= embed("./examples/example.txt") %}
We can easily match all the occurences with a regex, but we only get the char-index of each match.
Using the `line-counter` module, we can print line-numbers as well:
{%= replace(embed("./examples/regex-matches.js"),"../",name) %}
{%= apidocs("index.js") %}
{%= include("tests") %}
{%= include("contributing") %}
{%= include("author", {github: 'nknapp', twitter: 'knappi79'}) %}
{%= license() %}
{%= read("./CHANGELOG.md") %}