UNPKG
lbl
Version:
latest (0.1.0)
0.1.0
0.0.1
Process stdin, line by line, sort of like AWK but 100% JS
github.com/busterc/lbl
busterc/lbl
lbl
/
lib
/
__tests__
/
scripts
/
X.js
21 lines
(19 loc)
•
320 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict'
;
/* global $, log, chalk, n:true, f:true */
module
.
exports
= {
each
:
x
=>
{ n++;
if
(x.
match
(
/^X/
)) {
log
(chalk.
yellow
(
'> '
) + x); f++; } },
before
:
() =>
{ $.n =
0
; $.f =
0
;
log
(
'<<BEGIN>>'
); },
after
:
() =>
{
log
(
'> Matched '
+ f +
' from '
+ n); } };