New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

result-core

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

result-core - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

5

index.js

@@ -6,3 +6,4 @@

module.exports = Result
module.exports = exports = Result
exports.addListener = listen

@@ -133,3 +134,3 @@ /**

* @param {Function} fn
* @api private
* @api public
*/

@@ -136,0 +137,0 @@

2

package.json
{
"name": "result-core",
"version": "1.1.0",
"version": "1.1.1",
"description": "minimal result reification",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -6,4 +6,6 @@

Results are an attempt to re-build the call stack conceptual model back on top of the callback model. The approach they take is to ask you to reify your asynchronous function calls with a Result instance. These instances model a stack frame in that it will eventually be either a successfully computed value or an error. Once you have reified your async function calls with runtime objects you can compose them together and recreate the computation tree that is normally implicit and maintained underneath the runtime. This implementation does nothing to improve the stack traces of your errors but that feature could be added.
Results are an attempt to re-build the call stack conceptual model back on top of the "event loop" model. The approach they take is to ask you to reify your asynchronous function calls with a Result instance. The intention of these is to model stack frames, in that they will eventually be either a successfully computed value or an error. Because these Result instances are runtime objects you can compose them together to recreate the computation tree that is normally implicit and maintained underneath the runtime.
This implementation does nothing to improve the stack traces of your errors but that feature could be added.
## Installation

@@ -29,9 +31,9 @@

function add(a, b){
var result = new Result
result.write(a + b)
return result
var result = new Result
result.write(a + b)
return result
}
add(1, 2).read(function(n){
console.log('1 + 2 = %d', n)
console.log('1 + 2 = %d', n)
})

@@ -38,0 +40,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc