Add letter spacing to strings, for the browser and node.js. With or without you Promises.
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | lol ❌ |
For illustration purposes only.
Being sane:
$ yarn add letter-spacing
Using npm:
$ npm install letter-spacing
Using cdn:
Coming soon
const {spaced} = require('letter-spacing')
let example = 'YOU PUT AT RISK MILLIONS OF PEOPLE'
process.stdout.write(spaced(example))
Result:
Y O U P U T A T R I S K M I L L I O N S O F P E O P L E
spaced('yes, even webscale', 2)
y e s , e v e n w e b s c a l e
Space the text and convert it to uppercase.
spacedUp('code level x10')
C O D E L E V E L X 1 0
Print the text as a nice box.
spacedCake('accidentally quadratic')
a c c i d e n t a l l y q u a d r a t i c
c i
c t
i a
d r
e d
n a
t u
a q
l
l y
y l
l
q a
u t
a n
d e
r d
a i
t c
i c
c i t a r d a u q y l l a t n e d i c c a
Print the text as a cube.
spacedCube('WILL IT BLEND')
W I L L I T B L E N D
I N N
L E E
L L L
B B
I
T T T
I I
B
L L L
E L L
N I I
D N E L B T I L L I W W
N I I
E L L
L L L
B
I I
T T T
I
B B
L L L
L E E
I N N
W I L L I T B L E N D
Reverses the string before spacing.
decaps('lol')
l o l
Welcome to the promised land. The functions above are also available in promised versions:
Example:
spacedPromise('some text').then((str=>console.log(str)))
let str = await spacedPromise('some other text')
I guaranty the following as soon as this package is required by lots of other packages:
This guarantee will always be valid until the exact moment. Void where prohibited or when I change my mind.
letter-spacing is inspired by await-sleep. Ultimately letter-spacing is an effort to provide a await-sleep
-like one liner(s) module for use outside of sanity.
Some other inspirations were left-pad, event-stream, flatmap-stream and /r/programmingcirclejerk, especially the comments in the discussion about this package
MIT
This package is meant as a joke. If you seriously consider using this in one of your projects, you should be banned 5 meters from every device which can be programmed, including your microwave oven.
Read these:
The point is: Don't blindly add random npm packages, especially if they contain code you could easily duplicate into your own project like the oneliners from this project.
This packages might be fit for some purpose but it is hereby declared unfit for any purpose. If you don't understand, you probably shouldn't use this package. If you do, you probably wouldn't use this package.