Download Fore_End/cpcn2/node_modules/easy-stack/example/basic.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 342 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/easy-stack/example/basic.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/easy-stack/example/basic.js
-
curl -L -o basic.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/easy-stack/example/basic.js
342 Bytes
| var Stack=require('../stack'); | |
| //create a new Stack instance | |
| var stack=new Stack; | |
| stack.autoRun=false; | |
| for(var i=0; i<50; i++){ | |
| //add a bunch of stuff to the stack | |
| stack.add(makeRequest.bind(stack,i)); | |
| } | |
| stack.next(); | |
| function makeRequest(index){ | |
| //do stuff | |
| console.log(`making LIFO request ${index}`); | |
| this.next(); | |
| } | |