npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

@igor.dvlpr/astro-escaped-component

v1.0.0

Published

πŸƒπŸ»β€β™‚οΈβ€βž‘οΈ An Astro component that holds only HTML-encoded content. πŸ“œ

Downloads

6

Readme

πŸ“ƒ Table of contents

πŸ•΅πŸΌ Usage

Install it by executing:

npm i -D "@igor.dvlpr/astro-escaped-component"

🀹🏼 API

The API exposes a single Astro component Escaped, see a usage example below.

After importing the component into a project, add it to an Astro page markup as:

<Escaped is:raw>
 {/* text/code to be escaped */}
</Escaped>

[!IMPORTANT] The attribute is:raw is crucial for the component to work, if not specified, Astro will parse all content as pure HTML, including <script> and <style> tags.

[!CAUTION] This component escapes/encodes text using HTML entities and can help prevent XSS attacks. However, this may not be sufficient in all cases.

Ensure additional security measures are in place.


✨ Examples

example.astro

---
import Escaped from '@igor.dvlpr/astro-escaped-component'
---

<Escaped is:raw>
  Mitochondria are known as the "powerhouses" of the cell because they generate most of the cell's supply of ATP & CO<sub>2</sub>, which is used as a source of chemical energy.
  
  <, >, ", ', &, =, `, !, @, $, %, (, ), +, {, }, [, ].
  
  <script>console.log('Hello? No? 😭')</script>
</Escaped>

{/*

  Will be rendered as:

  Mitochondria are known as the &#34;powerhouses&#34; of the cell because they generate most of the cell&#39;s supply of ATP &#38; CO&#60;sub&#62;2&#60;/sub&#62;, which is used as a source of chemical energy.

  &#60;, &#62;, &#34;, &#39;, &#38;, &#61;, &#96;, &#33;, &#64;, &#36;, &#37;, &#40;, &#41;, &#43;, &#123;, &#125;, &#91;, &#93;.

  &#60;script&#62;console.log&#40;&#39;Hello? No? 😭&#39;&#41;&#60;/script&#62;

*/}

πŸ“ Changelog

πŸ“‘ The changelog is available here: CHANGELOG.md.


πŸͺͺ License

Licensed under the MIT license which is available here, MIT license.


🧬 Related

@igor.dvlpr/common-types

πŸ”¦ Provides frequently used types for your TypeScript projects. πŸ¦„

@igor.dvlpr/registry-apppaths

πŸͺ€ A Node.js module for reading the AppPaths registry key on Windows. Useful for retrieving applications that can be launched from the command prompt. πŸ—ƒ

@igor.dvlpr/scrollend-polyfill

πŸ›΄ A performant and light (< 1.5KB) JavaScript polyfill for the scrollend Event. ⛸️

@igor.dvlpr/astro-easynav-button

🧭 Add an easy-to-use navigational button (jump to top/bottom) to your Astro site. πŸ”Ό

@igor.dvlpr/windev

πŸƒ Provides ways of checking whether a path is a legacy Windows device. πŸ’Ύ


πŸ‘¨πŸ»β€πŸ’» Author

Created by Igor Dimitrijević (@igorskyflyer).