A Node.js library to expand URLs from shortening services by resolving redirects and detecting final destinations.
url-unshort is a Node.js library that expands URLs from shortening services by resolving HTTP redirects to reveal the original destination. It solves problems like hidden redirects, spam bypass, and user tracking by providing transparency into where short links actually lead. The library supports a wide range of services and includes features like caching and error retries.
Node.js developers building forums, blogs, comment systems, or any platform where users can post links and spam filtering or link transparency is needed.
Developers choose url-unshort for its comprehensive support of shortening services, customizable caching, and security-focused design that prevents protocol-based exploits. Its extensible provider system allows adaptation to new or custom shorteners.
Short links expander for node.js
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Comes with a built-in YAML file listing domains for popular services like Bitly and TinyURL, allowing expansion out of the box without manual setup.
Supports custom cache implementations such as Redis via promise-based get/set functions, reducing repeat HTTP requests and improving performance.
Automatically retries temporary network errors (e.g., 5xx responses) and provides an isErrorFatal utility to distinguish between retriable and fatal failures.
Allows adding custom shortening services with specific match patterns, validation functions, or fetch logic, making it adaptable to niche or new shorteners.
Every expansion requires an HTTP request to the shortening service, introducing delays and dependency on external network availability, which can impact performance.
Returns expanded URLs 'as is' without validation; developers must manually re-encode URLs using modules like Node.js 'url' to ensure safety and correctness, adding extra steps.
The built-in domains.yml file might not include newer or obscure shortening services, requiring manual updates or custom provider additions to stay current.