Socket
Socket
Sign inDemoInstall

js-awe

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-awe - npm Package Compare versions

Comparing version 1.0.40 to 1.0.41

2

package.json
{
"name": "js-awe",
"version": "1.0.40",
"version": "1.0.41",
"homepage": "https://github.com/josuamanuel/js-awe",

@@ -5,0 +5,0 @@ "author": "josuamanuel@hotmail.com",

@@ -5,2 +5,4 @@ # js-awe

## installation
**NodeJS:**

@@ -12,2 +14,14 @@

supporting import (ES Modules) and require (commonjs)
```javascript
import { plan } from 'js-awe'
```
or
```javascript
const { plan } = require('js-awe')
```
**100% compatible with bun:**

@@ -46,2 +60,26 @@

***The libary handles the mixing of sync and async functions seamlessly***
```javascript
const { plan } = require("js-awe")
const result = plan().build([
val1 => Promise.resolve(val1 * 2), // fun1: 3*2 = 6
[val2 => Promise.resolve(val2 + 1), val3 => val3 + 3], // fun2A: 6 + 1 = 7; fun3: 7 + 3 = 10
[val2 => Promise.resolve(val2 - 1), val4 => val4 + 2], // fun2B: 6 - 1 = 5; fun4: 5 + 2 = 7
([val4, val5]) => val4 + val5 // fun5: 10 + 7 = 17; Promise.resolve(17)
])(3)
result.then(result => console.log(result)) //=> 17
```
***Simple declarative way to specify running functions sequencially or concurrently***
```plainText
|-> fun2A -> fun3-|
fun1 --| |-> fun5
|-> fun2B -> fun4-|
```
***The purpose:***
Async await has done a lot to improve the readability of code when compared with callbacks style. But sometimes it is not a good construct, especially if you want to use it in a functional style!!!

@@ -97,3 +135,3 @@

You can see below is a simple example of its use. This could be part of an API to get the bank balances of all the holdings (savings and loans) for a specific customer:
You can see below a more realistic example of its use. This could be part of an API to get the bank balances of all the holdings (savings and loans) for a specific customer:

@@ -100,0 +138,0 @@ ```javascript

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