![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@jsweb/asyncs
Advanced tools
Simple JS module for Promise and Fetch APIs, with some useful abstraction
Simple JS module for Promise and Fetch APIs, with some useful abstraction
Create: date 2016-06-25 03:14:48
Modify: date 2018-10-13 21:07:09
Version: 3.0.3
Author: Alex Bruno git.alexbr@outlook.com
Example
import { requestJSON, requestAll, requestRace } from '@jsweb/asyncs'
Promise
Excute any function asyncronously with any number of arguments.
Export: function
Param | Type |
---|---|
fn | function |
...args | arguments |
Promise
Turn any input in a Promise to use is on asyncronous threads
Export: function
Param | Type |
---|---|
input | * |
Promise
Turn any number of arguments into asyncronous group to resolve only if all threads resolve.
Export: function
Param | Type |
---|---|
...args | arguments |
Promise
Turn any number of arguments into asyncronous race to resolve or reject with the fastest thread.
Export: function
Param | Type |
---|---|
...args | arguments |
*
Execute any function asyncronously As Soon As Possible with any number of arguments.
Export: function
Param | Type |
---|---|
fn | function |
...args | arguments |
Promise
Execute asyncronous HTTP requests with configurable options.
It uses Fetch API with some useful abstractions.
To send parameters on request, just add a body
in cfg
containing the object for any HTTP method request.
GET requests (default), will serialize parameters into a query string.
Other methods will convert parameters into FormData object if necessary.
So you can also send HTML Form or FormData object for non GET requests.
It is also possible to send JSON content. Just set content-type
to application/json
at cfg.headers
.
Then your cfg.body
literal object will be serialized using JSON.stringify
.
The promise returned also checks HTTP response. Any status >= 300 will cause a Promise.reject
.
Export: function
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Use execAll
to make a request
for each urls
using the same cfg
and resp
type for all.
The returned Promise resolves only if all requests resolve.
If any request fails it will cause an entire Promise.reject
.
Possible response types are: response, json, text, blob, boolean, number, xml and html.
Export: function
Param | Type | Default |
---|---|---|
urls | Array.<string> | |
[cfg] | RequestInit | {} |
[resp] | string | "'response'" |
Promise
Use execRace
to make a request
race with all urls
using the same cfg
and resp
type for all.
The returned Promise resolves or rejects with the fastest request.
Possible response types are: response, json, text, blob, boolean, number, xml and html.
Export: function
Param | Type | Default |
---|---|---|
urls | Array.<string> | |
[cfg] | RequestInit | {} |
[resp] | string | "'response'" |
Promise
Execute a request
expecting for a valid JSON response.
HTTP errors or invalid JSON response will cause a Promise.reject
.
Export: funtion
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Execute a request
expecting for any response and get it as text.
HTTP errors will cause a Promise.reject
.
Export: function
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Execute a request
expecting for a valid Blob response.
HTTP errors or not readable Blob response will cause a Promise.reject
.
Export: function
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Execute a request
expecting for any response and get it as boolean.
HTTP errors will cause a Promise.reject
.
Export: function
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Execute a request
expecting for a valid Number response.
The response can be number, string or any value that can be parsed as Number.
Invalid values will resolve as NaN
object (not a number).
HTTP errors will cause a Promise.reject
.
Export: function
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Execute a request
expecting for a valid XML document response.
HTTP errors response will cause a Promise.reject
.
Export: function
Param | Type | Default |
---|---|---|
url | string | |
[cfg] | RequestInit | {} |
Promise
Execute a request
expecting for any response and get it as HTML.
HTTP errors response will cause a Promise.reject
.
Export: function
Param | Type |
---|---|
url | string |
[cfg] | RequestInit |
FAQs
Simple JS module for Promise and Fetch APIs, with some useful abstraction
The npm package @jsweb/asyncs receives a total of 3 weekly downloads. As such, @jsweb/asyncs popularity was classified as not popular.
We found that @jsweb/asyncs 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.