Skip to content

Fayti1703/async-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

@fayti1703/async-utils

Various async utility functions

slurp(stream, encoding)

"Slurps" the given stream; all remaining data will be consumed and returned.

Note: This function rejects if the stream emits an 'error' event.

request(options, body, encoding)

Sends a HTTPS request to the specified server. The resulting response is passed to msgToObj, the result of which is returned.

requestInsecure(options, body, encoding)

Sends a HTTP request to the specified server. This function acts just as request does otherwise.

msgToObj(message)

Converts message into an equivalent object with an added data property and toString function.

Note: Due to the implementation of this function, properties from the message may be dropped. If this includes a property you need, please file a bug report.

sleep(ms)

  • ms [<number>][number] How long to sleep for

An alias for setTimeout[util.promisify.custom].

About

Various (Async) Promise Utility Functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published