2.8.0 • Published 3 months ago

klor v2.8.0

Weekly downloads
96
License
Unlicense
Repository
github
Last release
3 months ago

klor

klor is a simple syntax highlighting tool. It exports the following function:

parse lines, ext

  • lines: array of strings
  • ext: file type
    • coffee js ts
    • styl css sass
    • pug html svg
    • bash fish sh
    • cpp hpp c h
    • noon json
    • md plist

returns an array of objects:

[
    ext:    string              
    chars:  number              
    index:  number              
    number: index+1 
    chunks: [
                match:  string  # without whitespace characters
                clss:   string  # value of match
                turd:   string  # following punctuation characters
                start:  number  # character index of match in line
                length: number  # length of match
            ]
...
]

See kolor.map for a list of recognized chunk values.

🌈 kolor

kolor is a submodule which exports a bunch of functions for wrapping strings in 256 color ansi codes.

It's a merge of colorette and ansi-256-colors

klor = require 'klor'
klor.kolor.globalize() # hoist color functions into the global scope
log y8 'bright yellow' + R1 'on dark red'

npm package Build Status downloads Dependencies Status

2.8.0

3 months ago

2.7.0

3 months ago

2.6.0

3 months ago

2.5.0

3 months ago

2.4.0

4 months ago

2.3.0

5 months ago

2.1.0

7 months ago

2.0.0

7 months ago

1.8.0

7 months ago

1.6.0

7 months ago

1.4.0

11 months ago

1.3.0

11 months ago

1.2.0

11 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago

0.63.0

12 months ago

0.62.0

12 months ago

0.61.0

12 months ago

0.60.0

12 months ago

0.59.0

12 months ago

0.58.0

12 months ago

0.57.0

12 months ago

0.56.0

12 months ago

0.55.0

12 months ago

0.54.0

12 months ago

0.53.0

12 months ago

0.52.0

12 months ago

0.51.0

12 months ago

0.50.0

1 year ago

0.49.0

1 year ago

0.48.0

1 year ago

0.47.0

1 year ago

0.46.0

1 year ago

0.45.0

1 year ago

0.44.0

1 year ago

0.43.0

1 year ago

0.42.0

1 year ago

0.41.0

1 year ago

0.40.0

1 year ago

0.39.0

1 year ago

0.37.0

1 year ago

0.36.0

1 year ago

0.35.0

1 year ago

0.34.0

1 year ago

0.33.0

1 year ago

0.31.0

1 year ago

0.29.0

1 year ago

0.28.0

1 year ago

0.26.0

1 year ago

0.25.0

1 year ago

0.24.0

1 year ago

0.21.0

1 year ago

0.15.0

1 year ago

0.13.0

1 year ago