Create a minimap like the sublime text editor for given text input using braille characters
var minimapper = require('mini-mapper');
var s = 'hello world\nthis is a test\nfor the mini-mapper\nnode-module';
minimapper(s);
// => "⣿⣟⣵⣏⣯⡷⠶⠤⠤⠄"
$ mini-mapper < package.json
⠁⣶⣶⣶⣦⣶⣲⣶⢶⣶⣖⣒⢀⢀⣀⣀⣀⢀⣀⡀⣀⡀⣀⣀⣀⡀⣀⣀⢀⣀⣀⡀⣀⡀⣀⣀⡀⣀⣀⢀⣀⣀⣀
⠀⣛⠿⠿⠷⠟⠽⠭⠍⠭⠭⠭⠭⠡⠄⠤⠤⠠⠤⠤⠤⠤⠤⠠⠄⠤⠤⠠⠄
⠀⣭⣛⣛⣚⣒⣒⡒⡒⠐⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠂
⠀⣤⣛⣛⣛⣑⡛⡛⠛⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒
⠀⠀⣿⣿⣿⣯⡭
⠀⣿⣶⣶⡶⡦⠲⠶⠦⠖⠒⠐⠒⠒⠒⠒⠒⠒⠒⠒⠒⠐⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒
⠀⣶⣭⣭⣭⣬⣍⣭⡭⡭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠭⠉⠁
⠂⠁
Given a string s
, this function returns a braille mini-mapped string.
s
: the string to minimapopts
: options objectopts.tab
: character(s) to expand tabs to, defaults to' '
(four spaces)
Module
npm install mini-mapper
Command-line tool
[sudo] npm install -g mini-mapper
MIT License