Skip to content

Commit 996afe7

Browse files
committed
adding stack exposure
1 parent 96e82aa commit 996afe7

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
5. any simple or complex queue operations
1010
6. base class to extend
1111
7. anything else that needs a queue
12+
8. Anything which needs a stack instead of a queue.
1213

1314

1415
# Stable and easy to use
1516
Works great in node.js, webpack, browserify, or any other commonjs loader or compiler. To use in plain old vanilla browser javascript without common js just replace the requires in the examples with script tags. We show that below too.
1617

18+
` js-queue ` also exposes the ` easy-stack ` stack via ` require('js-queue/stack.js') ` this file exposes an ES6 stack which allows for Last In First Out (LIFO) queuing. This can come in handy depending on your application needs, check out the [easy-stack javascript documentation](https://github.com/RIAEvangelist/easy-stack) it follows the ` js-queue ` interface but is node 6 or greater as it uses ES6 classes.
19+
1720
**npm install js-queue**
1821

1922
npm info : [See npm trends and stats for js-queue](http://npm-stat.com/charts.html?package=js-queue&author=&from=&to=)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-queue",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Simple JS queue with auto run for node and browsers",
55
"main": "queue.js",
66
"scripts": {

queue.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Queue(){
1+
function Queue(asStack){
22
Object.defineProperties(
33
this,
44
{
@@ -38,16 +38,16 @@ function Queue(){
3838
var queue=[];
3939
var running=false;
4040
var stop=false;
41-
41+
4242
function clearQueue(){
4343
queue=[];
4444
return queue;
4545
}
46-
46+
4747
function getQueue(){
4848
return queue;
4949
}
50-
50+
5151
function setQueue(val){
5252
queue=val;
5353
return queue;

stack.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const Stack=require('easy-stack');
2+
3+
module.exports = Stack;

0 commit comments

Comments
 (0)