
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
just-a-stack
Advanced tools
A linked list implementation of a stack.
###Objects###
Stack
The stack object returned when require is called on this library
var Stack = require('just-a-stack');
var stack = new Stack();
###Methods###
push(data)
Pushes data onto the top of the stack
var text = "i like to do drawings";
stack.push(text);
console.log(stack.peek());
//> i like to do drawings
pop()
Pops data off the top of the stack
var intro = "hello my name";
stack.push(intro);
var name = "is simon";
stack.push(name);
console.log(stack.pop());
//> is simon
peek()
Returns the data on the top of the stack without modifying the stack
var intro = "hello my name";
stack.push(intro);
var name = "is simon";
stack.push(name);
console.log(stack.peek());
//> is simon
console.log(stack.pop());
//> is simon
size()
Returns the size of the stack
console.log(stack.size());
//> 2
isEmpty()
Convience method that checks if the stack size is 0
if (!stack.isEmpty()) {
while(stack.pop());
}
console.log(stack.isEmpty());
//> true
FAQs
just a stack implementation
The npm package just-a-stack receives a total of 2 weekly downloads. As such, just-a-stack popularity was classified as not popular.
We found that just-a-stack 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.