T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/.local/lib/code-server-4.102.2/node_modules/es6-promisify/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/.local/lib/code-server-4.102.2/node_modules/es6-promisify/README.md
![Build Status](https://github.com/digitaldesignlabs/es6-promisify/actions/workflows/test.yml/badge.svg)

# es6-promisify

Converts callback-based functions to Promises, using a boilerplate callback function.

## Install

Install with [npm](https://npmjs.org/package/es6-promisify)

```bash
npm install es6-promisify
```

## Example

```js
const {promisify} = require("es6-promisify");

// Convert the stat function
const fs = require("fs");
const stat = promisify(fs.stat);

// Now usable as a promise!
try {
    const stats = await stat("example.txt");
    console.log("Got stats", stats);
} catch (err) {
    console.error("Yikes!", err);
}
```

## Promisify methods

```js
const {promisify} = require("es6-promisify");

// Create a promise-based version of send_command
const redis = require("redis").createClient(6379, "localhost");
const client = promisify(redis.send_command.bind(redis));

// Send commands to redis and get a promise back
try {
    const pong = await client.ping();
    console.log("Got", pong);
} catch (err) {
    console.error("Unexpected error", err);
} finally {
    redis.quit();
}
```

## Handle multiple callback arguments, with named parameters

```js
const {promisify} = require("es6-promisify");

function test(cb) {
    return cb(undefined, 1, 2, 3);
}

// Create promise-based version of test
test[promisify.argumentNames] = ["one", "two", "three"];
const multi = promisify(test);

// Returns named arguments
const result = await multi();
console.log(result); // {one: 1, two: 2, three: 3}
```

## Provide your own Promise implementation

```js
const {promisify} = require("es6-promisify");

// Now uses Bluebird
promisify.Promise = require("bluebird");

const test = promisify(cb => cb(undefined, "test"));
const result = await test();
console.log(result); // "test", resolved using Bluebird
```

### Tests

Test with tape

```bash
$ npm test
```

Published under the [MIT License](http://opensource.org/licenses/MIT).

CasperSecurity Mini