New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sequence-paths

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequence-paths

generate an array of paths to load an image sequence assets

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

sequence-paths

Create an array of sequential filenames between a provided range and with a consistent length of numerals.

NPM

##Usage

sequencePaths( basePath, lastFrame, [extension, numLength, firstFrame] )

  • String basePath the beginning of the file location
  • Number lastFrame the number on the filename of the last frame, inclusive.
  • String [extension] the file-extension, defaults to '.png'
  • Number [numLength] the number of leading-zeros for numbers, defaults to 4
  • Number [firstFrame] the first frame of the sequence, inclusive, defaults to 0

Basic usage:

var sequencePaths = require('sequence-paths');

sequencePaths('/images/intro-', 16, 'jpg');
//=> ['/images/intro-00000.jpg', …, '/images/intro-00016.jpg']

Customize the length of each number in the files string, here all numbers will be 2 characters long:

sequencePaths('images/intro-', 16, 'jpg', 2)
//=> ['/images/intro-00.jpg', …, '/images/intro-16.jpg']

Start the sequence on a frame number other than 0:

sequencePaths('images/intro-', 32, 'jpg', 3, 17)
//=> ['/images/intro-017.jpg', …, '/images/intro-032.jpg']

##License

MIT, see LICENSE.md for details.

Keywords

array

FAQs

Package last updated on 15 Apr 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