A JavaScript library for parsing shared links from popular content-sharing platforms into direct image and video URLs, based on the service provided by SnapAny.
You can install snapany
via npm:
npm install snapany
Import the parse function into your JavaScript or TypeScript file:
You can import the library using import
:
import { parse } from 'snapany';
Or using require
:
const { parse } = require('snapany');
Now, you can receive the parsed data as a Promise by calling the parse
function with the URL:
const result = await parse(url);
console.log(result);