🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

tinysequence.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinysequence.js

An extremely tiny (257 bytes) sequence generator.

1.0.2
latest
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

tinysequence.js

An extremely tiny (257 bytes) sequence generator.

Build Status

Install

Through NPM

npm install tinysequence.js

Through Bower

bower install tinysequence.js

In the browser

<script src="/path/to/tinysequence.min.js"></script>

Usage

ts(count, delimiter, transform);

Simple

var seq = ts(5);
return seq; // [0, 1, 2, 3, 4]

var stringSeq = ts(5, " ");
return stringSeq; // "0 1 2 3 4"

Custom Delimiter

var seq = ts(3, ":");
return seq; // "0:1:2"

Iteration transformer

var seq = ts(3, " ", function(x){
  return "foo-" + (x+1) + "-bar";
});
return seq; // "foo-1-bar foo-2-bar foo-3-bar"

Keywords

sequence

FAQs

Package last updated on 29 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts