npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

letter-spacing

v1.0.13

Published

Add letter spacing to strings, for the browser and node.js. With or without ~~you~~Promises.

Downloads

13

Readme

letter-spacing

npm version build status code coverage install size npm downloads stupid

Add letter spacing to strings, for the browser and node.js. With or without ~~you~~ Promises.

Features

  • Easy to use npm module to add letter spacing to strings with configurable spacing width
  • Various variants of spacing, including a 2D version
  • Promisified method versions for modern codebases
  • Secure and trusted
  • Meets the ideals of code-reuse and dependency management
  • Comes with guarantees (see below)

Browser Support

Chrome | Firefox | Safari | Opera | Edge | IE | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | lol ❌ |

For illustration purposes only.

Installing

Being sane:

$ yarn add letter-spacing

Using npm:

$ npm install letter-spacing

Using cdn:

Coming soon

Example

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

letter-spacing API

Synchronous Methods

spaced(str, [spacing=1])
spaced('yes, even webscale', 2)
y  e  s  ,     e  v  e  n     w  e  b  s  c  a  l  e
spacedUp(str, [spacing=1])

Space the text and convert it to uppercase.

spacedUp('code level x10')
C O D E   L E V E L   X 1 0

spacedCake(str)

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

spacedCube(str)

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
decaps(str, [spacing=1])

Reverses the string before spacing.

decaps('lol')
l o l

Promised methods

Welcome to the promised land. The functions above are also available in promised versions:

spacedPromise(str, [spacing=1])
spacedUpPromise(str, [spacing=1])
spacedCakePromise(str)
spacedCubePromise(str)
decapsPromise(str, [spacing=1])

Example:

spacedPromise('some text').then((str=>console.log(str)))
let str = await spacedPromise('some other text')

Guarantees

I guaranty the following as soon as this package is required by lots of other packages:

  • I probably will not pass over this repository to someone unknown with no credibility from china (or for the matter of fact, every other country) when i'm no longer interested in this
  • I likely might not delete this package when npmjs hurts my feelings
  • If there will be minified code in the package as distributed on npmjs it will come from the same source code or a different source code as in this repository
  • There is no ~~obfuscated code~~ (well let's face it, it's JavaScript, it comes out obfuscated) which tries to decrypt some fetched crypted js and then executes it under specific circumstances
  • I most likely will not try to mitigate my terrible mistake of not buying bitcoins when they were like 100000 for 5 Euro by stealing your precious cryptocurrency

This guarantee will always be valid until the exact moment. Void where prohibited or when I change my mind.

Resources

Credits

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

License

MIT

If you didn't got it by now

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.

Final Disclaimer

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.