Gathering detailed insights and metrics for @google-cloud/promisify
Gathering detailed insights and metrics for @google-cloud/promisify
Gathering detailed insights and metrics for @google-cloud/promisify
Gathering detailed insights and metrics for @google-cloud/promisify
A simple utility for promisifying functions and classes.
npm install @google-cloud/promisify
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
17 Stars
252 Commits
15 Forks
43 Watching
87 Branches
113 Contributors
Updated on 23 Oct 2024
Minified
Minified + Gzipped
TypeScript (83.02%)
JavaScript (12.96%)
Python (4.02%)
Cumulative downloads
Total Downloads
Last day
2%
1,288,631
Compared to previous day
Last week
2.9%
6,633,540
Compared to previous week
Last month
12.2%
27,657,078
Compared to previous month
Last year
38.7%
282,106,896
Compared to previous year
A simple utility for promisifying functions and classes.
A comprehensive list of changes in each version may be found in the CHANGELOG.
Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.
Table of contents:
1npm install @google-cloud/promisify
1const {promisify} = require('@google-cloud/promisify'); 2 3/** 4 * This is a very basic example function that accepts a callback. 5 */ 6function someCallbackFunction(name, callback) { 7 if (!name) { 8 callback(new Error('Name is required!')); 9 } else { 10 callback(null, `Well hello there, ${name}!`); 11 } 12} 13 14// let's promisify it! 15const somePromiseFunction = promisify(someCallbackFunction); 16 17async function quickstart() { 18 // now we can just `await` the function to use it like a promisified method 19 const [result] = await somePromiseFunction('nodestronaut'); 20 console.log(result); 21} 22quickstart(); 23
It's unlikely you will need to install this package directly, as it will be
installed as a dependency when you install other @google-cloud
packages.
Samples are in the samples/
directory. Each sample's README.md
has instructions for running its sample.
Sample | Source Code | Try it |
---|---|---|
Quickstart | source code |
The Google Cloud Common Promisify Node.js Client API Reference documentation also contains samples.
Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.
Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed through npm dist-tags.
The dist-tags follow the naming convention legacy-(version)
.
For example, npm install @google-cloud/promisify@legacy-8
installs client libraries
for versions compatible with Node.js 8.
This library follows Semantic Versioning.
This library is considered to be stable. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against stable libraries are addressed with the highest priority.
More Information: Google Cloud Platform Launch Stages
Contributions welcome! See the Contributing Guide.
Please note that this README.md
, the samples/README.md
,
and a variety of configuration files in this repository (including .nycrc
and tsconfig.json
)
are generated from a central template. To edit one of these files, make an edit
to its templates in
directory.
Apache Version 2.0
See LICENSE
No vulnerabilities found.
Reason
all changesets reviewed
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More