Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
vnls-promise
Advanced tools
Cross platform Promise.
On node nodejs
npm install vnls
npm install vnls-event
npm install vnls-promise
Then, somewhere at the top of your code
require('vnls');
require('vnls-event');
require('vnls-promise');
There is no need to bind it to a var because var VNLS is made global to the nodejs process so it's behavior is exactly like in a browser environment. All-though this IS a kind of pollution on nodejs.
In a browser (you may also download the file first):
<script type="text/javascript" src="https://raw.githubusercontent.com/jorritd/vnls/master/lib/vnls.min.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/jorritd/vnls-event/master/lib/vnls-event.min.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/jorritd/vnls-promise/master/lib/vnls-promise.min.js"></script>
var promise = VNLS.getObject('event',"Promise");
promise.Do('set a timeOut and 2 increments',
// Can we pass something
// extra to 'this' promise
function(promise){
callback_counter ++;
setTimeout(function(){
// promise.done();
setTimeout(function(){
promise.done();
},100);
},100);
},
function(promise){
callback_counter ++;
promise.done();
},
function(promise){
callback_counter ++;
promise.done();
}
).whenDone( function(){
success_called = true;
}).whenFail( function(){
error_called = true;
});
or:
promise.Do(
function(promise){
callback_counter ++;
promise.done();
},
function(promise){
callback_counter ++;
// This block is causing an error
// So the next block will be valid
promise.fail();
},
function(promise){
callback_counter ++;
promise.done();
}
).orDo(
function(promise){
callback_counter ++;
promise.done();
},
function(promise){
callback_counter ++;
promise.done();
},
function(promise){
callback_counter ++;
promise.done();
}
).whenDone( function(){
success_called = true;
}).whenFail( function(){
error_called = true;
});
or:
promise.Do(
function(promise){
promise.done();
}
).thenDo(
function(promise){
// console.log('Then called');
setTimeout(function(){
// console.log('READY');
// self.pOptions.current_level == 2 at this position
// console.log(u.inspect(promise),true);
promise.done();
},100);
}
).orDo(
function(promise){
// console.log('Or called');
// console.log('ERROR');
// console.log(u.inspect(promise),true);
promise.fail();
}
).whenDone( function(){
success_called = true;
}).whenFail( function(){
error_called = true;
});
npm install jasmine-node
npm install nodewatch
npm install uglify-js
npm install -g jake
For jake these are the commands:
jake compress
: build minified version in './lib/*'jake test
: run the specsjake autotest
: run the specs on a filechange for TDDFor testing in a browser environment just point your browser to 'specs/index.html'.
It should run the same specs as jake test
does. (The tests cover both browser and server)
FAQs
Promises
The npm package vnls-promise receives a total of 0 weekly downloads. As such, vnls-promise popularity was classified as not popular.
We found that vnls-promise 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.