steem-link-extractor
A simple tools to extract links and generate links for different steem platform.
About Steem Link Extractor
In Steem blockchain, there is so many apps that used different kind of pathname to keep track of profile and post. This project aims to unite them all.
Technology Stack:
- TypeScript
- Jest
- Rollup
Housekeeping
- Checkout Changelog for updates.
- Checkout Contributing to contribute to this project.
Installation
$ npm i --save steem-link-extractor$ yarn add steem-link-extractor
Requirement
- URL API required.
- Node 10+ (support
new URL
, refer to this) - not IE 11 (Refer to URL)
Polyfill required to support this library.
Usage
You can checkout example at index.js and index.mjs
Import
ES5 import / TS Import
;
CommonJS
const extractPostLink generateProfileLink generatePostLink } = ;
API
// extractPostLink // Extract with predefined link.jsonconsole;/** Output * { * name: 'steemit', * author: 'superoo7', * permlink: 'side-to-side-comparison-of-digital-ocean-and-aws-lightsail', * category: 'cloud' * } */ // Extract without predefined link.json (Assuming it is not yet being add into link.json)// Currently presuming the site pathname is following format: `anything/anything/@{{author}}/{{permlink}}`// author startsWith "@" and followed by permlinkconsole; // generateProfileLink console;/** Output * https://musing.io/profile/superoo7 */ // generatePostLink console;/** Output * https://steemhunt.com/@superoo7/tailwind-css-utility-first-css-framework */ // if you have categoryconsole;/** Output * https://steemit.com/cloud/@superoo7/side-to-side-comparison-of-digital-ocean-and-aws-lightsail */
LICENSE
MIT