Displaying 1 to 15 from 15 results

left-pad - :arrow_left: String left pad

  •    Javascript

NOTE: The third argument should be a single char. However the module doesn't throw an error if you supply more than one chars. See #28. NOTE: Characters having code points outside of BMP plan are considered a two distinct characters. See #58.

add-line-numbers - adds line numbers to a source string

  •    Javascript

Adds line numbers to a source string, padding left and starting at the given offset.Adds a number to the start of each line in the str text.




layout-bmfont-text - word-wraps and lays out text glyphs

  •    Javascript

Provides layout and word-wrapping for left-to-right Latin text, primarily aimed at bitmap font rendering in Canvas/WebGL. The input font should be in the format of BMFont json, see here.You can use bmfont-lato for testing, or load-bmfont for Node/Browser loading.

cat-pad - 🐈 Left pad a string with cats

  •    Javascript

Pads input with cats on the left side if it's shorter than length. Padding cats are truncated if they exceed length.String to pad.

pad-left - Left pad a string with zeros or a specified string. Fastest implementation.

  •    Javascript

Left pad a string with zeros or a specified string. Fastest implementation. You might also be interested in word-wrap.


repeat-string - Repeat the given string n times

  •    Javascript

Repeat the given string n times. Fastest implementation for repeating a string. Repeat the given string the specified number of times.

mouse-event - Cross browser mouse event property access

  •    Javascript

Provides a normalized, cross-browser, garbage-collection-free API for reading out the state of a mouse event. Because it is 2015 and somehow every major browser still disagrees on even the most basic details of MouseEvents. Seriously guys.

inorder-tree-layout - Index calculations for balanced binary search trees in in-order layout

  •    Javascript

Operations on nodes for balanced binary trees stored in in-order layout. These are useful if you are building data structures, like binary search trees, implicitly (ie not storing pointers to subtrees). Returns the index of the root of a tree of size n.

mouse-event-offset - get relative position in an element on mouse clicks

  •    Javascript

Computes the [ offsetX, offsetY ] from a mouse or touch event, relative to the top left of the target element. Pass a MouseEvent or TouchEvent as event.

leftpad-sdk - Why write your own string left-padding function when you can use an NPM module that calls a remote RESTful API?

  •    Javascript

The thing is, using APIs is hard as we all know so I decided to implement this helpful library to ease the burdens of remote string padding. To ensure backwards compatibility with the original left-pad this module has been developed in exactly 11 lines of code. That seems to be the most crucial point to come across when reading all the articles written about it. This will print #############foo bar.






We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.