cyclist

WebJar for cyclist

License

License

MIT
Categories

Categories

CLI User Interface
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

cyclist
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

cyclist
WebJar for cyclist
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mafintosh/cyclist

Download cyclist

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/cyclist/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>cyclist</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/cyclist/
implementation 'org.webjars.npm:cyclist:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/cyclist/
implementation ("org.webjars.npm:cyclist:1.0.1")
'org.webjars.npm:cyclist:jar:1.0.1'
<dependency org="org.webjars.npm" name="cyclist" rev="1.0.1">
  <artifact name="cyclist" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='cyclist', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "cyclist" % "1.0.1"
[org.webjars.npm/cyclist "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Cyclist

Cyclist is an efficient cyclic list implemention for Javascript. It is available through npm

npm install cyclist

build status

What?

Cyclist allows you to create a list of fixed size that is cyclic. In a cyclist list the element following the last one is the first one. This property can be really useful when for example trying to order data packets that can arrive out of order over a network stream.

Usage

var cyclist = require('cyclist')
var list = cyclist(4)

list.put(42, 'hello 42') // store something and index 42
list.put(43, 'hello 43') // store something and index 43

console.log(list.get(42)) // prints hello 42
console.log(list.get(46)) // prints hello 42 again since 46 - 42 == list.size

API

  • cyclist(size) creates a new buffer
  • cyclist#get(index) get an object stored in the buffer
  • cyclist#put(index,value) insert an object into the buffer
  • cyclist#del(index) delete an object from an index
  • cyclist#size property containing current size of buffer

License

MIT

Versions

Version
1.0.1
0.2.2-1
0.2.2