
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
listcontrol
Advanced tools
Unlike some other programming languages (like PHP), JavaScript does not have an internal pointer for iterable objects. Though it is not a necessacity, it is a nice-to-have functionality is some situations.
ListControl.js aims to provide that functionality. It is extended from the native Array prototype, so you can use it like a normal Array with the internal pointer functionality attached.
npm install listcontrol
const ListControl = require('listcontrol');
const list = new ListControl('a', 'b', 'c');
OR with HTML:
<script src="path/to/listcontrol.min.js"></script>
<script>
const list = new ListControl('a', 'b', 'c');
</script>
.indexThe property is the main pointer. Though it is writable, you are highly discouraged from replacing the value of this property under most circumstances.
list.index
// -> 0
.current()Returns the current item of the instance.
list.current()
// -> 'a'
.next()Increments the pointer index by 1 if there is a next item in the instance. Returns the next item if there is a next item or undefined otherwise.
list.next()
// -> 'b'
list.index
// -> 1
list.next()
// -> 'c'
list.index
// -> 2
list.next()
// -> undefined
list.index
// -> 2
.previousIncrements the pointer index by 1 if there is a previous item in the instance. Returns the previous item if there is a previous item or undefined otherwise.
list.previous()
// -> 'b'
list.index
// -> 1
list.previous()
// -> 'a'
list.index
// -> 0
list.previous()
// -> undefined
list.index
// -> 0
.last()Moves the pointer index to the last and returns the last item in the instance.
list.last()
// -> 'c'
list.index
// -> 2
.first()Moves the pointer index to the start and returns the first item in the instance.
list.first()
// -> 'a'
list.index
// -> 0
FAQs
A simple JavaScript tool as internal pointer in lists.
The npm package listcontrol receives a total of 3 weekly downloads. As such, listcontrol popularity was classified as not popular.
We found that listcontrol demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.