Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 30, 2024 via pnpm
Package summary
Share
0
issues
1
license
1
MIT
Package created
24 Nov 2020
Version published
24 Nov 2020
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
yocto-queue@0.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of yocto-queue 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does yocto-queue do?

Yocto-queue is a tiny queue data structure developed for JavaScript programming. It should be used instead of an array for operations that involve a lot of Array#push() and Array#shift() on large arrays. This is due to the fact that while Array#shift() has linear time complexity O(n), the Queue#dequeue() function in yocto-queue has constant time complexity O(1). This results in huge efficiency advantages, especially for large arrays. A queue, as the name suggests, is an ordered list of elements where an element is inserted at the end (enqueued) and is removed from the front (dequeued) based on a first-in, first-out principle (FIFO). This tiny data structure is incredibly beneficial in optimizing performance when managing large data in your applications.

How do you use yocto-queue?

To use yocto-queue in your JavaScript project, first, you need to install it using npm by npm install yocto-queue command. Here is a simple usage example in JavaScript:

import Queue from 'yocto-queue';

const queue = new Queue();

queue.enqueue('πŸ¦„');
queue.enqueue('🌈');

console.log(queue.size); // Outputs: 2

console.log(...queue); // Outputs: 'πŸ¦„ 🌈'

console.log(queue.dequeue()); // Outputs: 'πŸ¦„'
console.log(queue.dequeue()); // Outputs: '🌈'

In the above example, two elements are enqueued to the queue instance. The size of the queue and the elements in it are printed to the console. After that, the two elements are dequeued one-by-one.

Where are the yocto-queue docs?

The documentation for yocto-queue can be found within the README in the package's GitHub repository. The API section of the README provides details on the usage of the data structure's methods such as .enqueue(value), .dequeue(), .clear(), and .size. The repository also includes related resources and packages which are useful for developers working on similar tasks.

All Versions