https://github.com/vladcosorg/promised-gateway
Gateway with automatic duplicate detection for running system commands, HTTP requests or any other slow or expensive promisified functions
https://github.com/vladcosorg/promised-gateway
abortable debouncing nodejs promises
Last synced: 24 days ago
JSON representation
Gateway with automatic duplicate detection for running system commands, HTTP requests or any other slow or expensive promisified functions
- Host: GitHub
- URL: https://github.com/vladcosorg/promised-gateway
- Owner: vladcosorg
- License: mit
- Created: 2023-03-26T21:38:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-18T23:40:08.000Z (over 2 years ago)
- Last Synced: 2025-12-02T19:26:24.731Z (6 months ago)
- Topics: abortable, debouncing, nodejs, promises
- Language: TypeScript
- Homepage:
- Size: 794 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

promised-gateway
Additonal promise-based helpers that let you handle some of the less common problems
## Installation
```bash
npm install promised-gateway
```
## Usage
```bash
$ ncc
```
Eg:
```bash
$ ncc build input.js -o dist
```
If building an `.mjs` or `.js` module inside a `"type": "module"` [package boundary](https://nodejs.org/dist/latest-v16.x/docs/api/packages.html#packages_package_json_and_file_extensions), an ES module output will be created automatically.
Outputs the Node.js compact build of `input.js` into `dist/index.js`.
> Note: If the input file is using a `.cjs` extension, then so will the corresponding output file.
> This is useful for packages that want to use `.js` files as modules in native Node.js using
> a `"type": "module"` in the package.json file.
#### Commands:
```
build [opts]
run [opts]
cache clean|dir|size
help
version
```
#### Options:
```
-o, --out [dir] Output directory for build (defaults to dist)
-m, --minify Minify output
-C, --no-cache Skip build cache population
-s, --source-map Generate source map
-a, --asset-builds Build nested JS assets recursively, useful for
when code is loaded as an asset eg for workers.
--no-source-map-register Skip source-map-register source map support
-e, --external [mod] Skip bundling 'mod'. Can be used many times
-q, --quiet Disable build summaries / non-error outputs
-w, --watch Start a watched build
-t, --transpile-only Use transpileOnly option with the ts-loader
--v8-cache Emit a build using the v8 compile cache
--license [file] Adds a file containing licensing information to the output
--stats-out [file] Emit webpack stats as json to the specified output file
--target [es] ECMAScript target to use for output (default: es2015)
Learn more: https://webpack.js.org/configuration/target
-d, --debug Show debug logs
```
### Execution Testing
For testing and debugging, a file can be built into a temporary directory and executed with full source maps support with the command:
```bash
$ ncc run input.js
```
# Motivation
This is yet another replacement for the `npm link`, which has tons of issues and works only for trivial cases. This is
also a replacement for other replacement packages which are either not maintained or a very clunky to use.
[](https://oclif.io)
[](https://npmjs.org/package/link-and-tink)
[](https://npmjs.org/package/link-and-tink)
[](https://github.com/oclif/hello-world/blob/main/package.json)
# Features
- Survives npm install
- All production dependencies and peer dependencies are installed along the main package (unlike npm link)
- Automatic reinstall of the changed dependencies
- No transitive dependencies
- Works with CRA, Vite, etc. hot reloading / hot module replacement (HMR)
- Fully automatic syncronisation between your project and linked dependency
- No 3rd-party config options in your package.json
- Out of the box support for TypeScript transpiler and other watchers
- Bidirectional sync
# Usage
# To Do
- Support other than NPM package managers
# Recipes
#Comparison table
https://docs.npmjs.com/cli/v9/commands/npm-link
https://github.com/wclr/yalc
https://github.com/privatenumber/link
https://hirok.io/posts/avoid-npm-link