Files
twtxt-lib/public/demo/parseTwtxt-example-source.js
Eric Woodward 1c06197be0 resolve issue with missing vite-plugin-node-polyfills
add LibreJS licenses to all demo JS
split browser build from node build
add copyright info to license files
update to use yarn v4.13.0
update to v0.9.2
2026-03-07 20:47:14 -05:00

32 lines
895 B
JavaScript

// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import formatSource from "./format-source.js";
formatSource(
`
\<script type="module">
import { parseTwtxt } from "/web/dist/twtxt-lib.js";
document
.getElementById("formParse")
.addEventListener("submit", async (ev) => {
ev?.preventDefault();
const url =
document.getElementById("parseURL")?.value ??
"/twtxt-demos/demo-hipster-twtxt.txt";
const response = await fetch(url);
const twtxtFile = await response.text();
const parsedFile = parseTwtxt(twtxtFile);
console.log(parsedFile);
});
<\/script>
`,
"tabParse-panel",
);
// @license-end