al-quran.reflectslight.io/packages/typescript/postman
2023-06-23 22:44:09 -03:00
..
src postman: export item before default 2023-06-23 22:44:09 -03:00
.gitignore Rename Packet to Postman (#131) 2023-06-23 22:31:25 -03:00
LICENSE Rename Packet to Postman (#131) 2023-06-23 22:31:25 -03:00
package.json Rename Packet to Postman (#131) 2023-06-23 22:31:25 -03:00
README.md Rename Packet to Postman (#131) 2023-06-23 22:31:25 -03:00
tsconfig.json Rename Packet to Postman (#131) 2023-06-23 22:31:25 -03:00

About

Postman is a JavaScript library that can download the dependencies of a web page, and afterwards display the web page with all of its dependencies in-place, ready to use.

An example of a dependency could be a font, an image, a script, a stylesheet, a JSON blob, and other formats can be downloaded as plain-text.

Examples

import postman, { item } from "postman";
packet(
  item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
  item.script("/js/app.js"),
  item.image("/images/app.png"),
  item.css("/css/app.css"),
  item.progress((percent) => {
    console.log(`${percent}%`)
  })
).fetch()
 .then((pkg) => {
    pkg.fonts.forEach((font) => documents.fonts.add(font));
    pkg.scripts.forEach((script) => document.body.appendChild(script));
    pkg.css.forEach((css) => document.head.appendChild(css));
 })

License

BSD Zero Clause.
See LICENSE.