Add comprehensive installation and setup documentation

- Add GETTING_STARTED.md with quick start guide and development modes
- Add INSTALL.sh automated installation script
- Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md
- Add QUICK_REFERENCE.md for common commands
- Add SETUP_GUIDE.md with detailed setup instructions
- Update README.md with improved project overview
- Add did-wallet app dependencies and node_modules
This commit is contained in:
Dorian
2026-01-27 17:18:21 +00:00
parent a81f655133
commit 0d073fa89e
22658 changed files with 4494151 additions and 6 deletions
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright © 2018 Vincent Weevers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+10
View File
@@ -0,0 +1,10 @@
export function fromCallback<T, S extends symbol>(callback: Callback<T> | undefined, symbol: S)
: Callback<T> & { [K in S]?: Promise<T> };
export function fromCallback<T>(callback: Callback<T> | undefined)
: Callback<T> & { promise?: Promise<T> };
export function fromPromise<T>(promise: Promise<T>, callback: Callback<T> | undefined)
: Promise<T> | undefined;
type Callback<T> = (err: Error | null, result: T) => void;
+28
View File
@@ -0,0 +1,28 @@
'use strict'
var nextTick = require('./next-tick')
exports.fromCallback = function (callback, symbol) {
if (callback === undefined) {
var promise = new Promise(function (resolve, reject) {
callback = function (err, res) {
if (err) reject(err)
else resolve(res)
}
})
callback[symbol !== undefined ? symbol : 'promise'] = promise
} else if (typeof callback !== 'function') {
throw new TypeError('Callback must be a function')
}
return callback
}
exports.fromPromise = function (promise, callback) {
if (callback === undefined) return promise
promise
.then(function (res) { nextTick(() => callback(null, res)) })
.catch(function (err) { nextTick(() => callback(err)) })
}
+1
View File
@@ -0,0 +1 @@
module.exports = typeof queueMicrotask === 'function' ? queueMicrotask : (fn) => Promise.resolve().then(fn)
+1
View File
@@ -0,0 +1 @@
module.exports = process.nextTick.bind(process)
+38
View File
@@ -0,0 +1,38 @@
{
"name": "catering",
"version": "2.1.1",
"description": "Simple utility to allow your module to be consumed with a callback or promise",
"license": "MIT",
"author": "Vincent Weevers",
"scripts": {
"test": "standard && node test.js",
"test-browsers-local": "airtap test.js"
},
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"next-tick.js",
"next-tick-browser.js"
],
"browser": {
"./next-tick.js": "./next-tick-browser.js"
},
"devDependencies": {
"airtap": "^4.0.4",
"airtap-playwright": "^1.0.1",
"standard": "^16.0.4",
"tape": "^5.4.0"
},
"keywords": [
"callback",
"promise",
"promisify"
],
"engines": {
"node": ">=6"
},
"repository": "vweevers/catering",
"bugs": "https://github.com/vweevers/catering/issues",
"homepage": "https://github.com/vweevers/catering"
}
+55
View File
@@ -0,0 +1,55 @@
# catering
**Cater to callback and promise crowds.**
Simple utility to allow your module to be consumed with a callback or promise. For Node.js and browsers.
[![npm status](https://img.shields.io/npm/v/catering.svg)](https://www.npmjs.com/package/catering)
[![Node version](https://img.shields.io/node/v/catering.svg)](https://www.npmjs.com/package/catering)
[![Test](https://img.shields.io/github/workflow/status/vweevers/catering/Test?label=test)](https://github.com/vweevers/catering/actions/workflows/test.yml)
[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com)
## Menu
If your module internally uses callbacks:
```js
const { fromCallback } = require('catering')
const kPromise = Symbol('promise')
module.exports = function (callback) {
callback = fromCallback(callback, kPromise)
queueMicrotask(() => callback(null, 'example'))
return callback[kPromise]
}
```
If your module internally uses promises:
```js
const { fromPromise } = require('catering')
module.exports = function (callback) {
return fromPromise(Promise.resolve('example'), callback)
}
```
Either way your module can now be consumed in two ways:
```js
example((err, result) => {})
const result = await example()
```
When converting from a promise to a callback, `fromPromise` calls the callback in a next tick to escape the promise chain and not let it steal your beautiful errors.
## Install
With [npm](https://npmjs.org) do:
```
npm install catering
```
## License
[MIT](LICENSE) © 2018-present Vincent Weevers. Originally extracted from [`levelup`](https://github.com/Level/levelup/blob/37e0270c8c29d5086904e29e247e918dddcce6e2/lib/promisify.js).