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

trop

v1.3.0

Published

Text to Poem Converter

Downloads

2

Readme

trop

Translate Operational Codes, a spicy text to HTML converter with UNIX line command-like syntax support.

Installation


  npm i -g trop

Usage


trop poem.txt

Example #0 (commands)

<html>

  <head>

    <meta>

  </head>

<body>


  $ youtube --id sR2v0Pfmzzc --images test/image --title "Hello" something
    $youtube -x --id sR2v0Pfmzzc --title "This is a description with \"text\"..."



</body>
</html>

Output


<html>

  <head>

    <meta>

  </head>

<body>


  <img title="Hello" src="test/image/yid-sR2v0Pfmzzc.jpg">

  <img title="This is a description with &quot;text&quot;..." src="dist/image/yid-sR2v0Pfmzzc.jpg">



</body>
</html>

The command is parsed into standard object format as follows:


// first command
youtube { _: [ 'something' ], id: 'BEEFFC00FFEE' }

// second command
youtube {
  _: [],
  x: true,
  id: 'C00FFEE',
  name: 'This is a description with "text"...'
}

Example #1 (messy HTML)


<html>

  <head>

    <meta>

  </head>

<body>


  Kosmos
  By Walt Whitman

  ---

  Who includes diversity and is Nature,
  Who is the amplitude of the earth, and the coarseness and sexuality of the earth, and the great charity of the earth and the equilibrium also,
  Who has not look’d forth from the windows the eyes for nothing, or whose brain held audience with messengers for nothing,

  Who contains believers and disbelievers, who is the most majestic lover,
  Who holds duly his or her triune proportion of realism, spiritualism, and of the æsthetic or intellectual,
  Who having consider’d the body finds all its organs and parts good,

  Who, out of the theory of the earth and of his or her body understands by subtle analogies all other theories,
  The theory of a city, a poem, and of the large politics of these States;

  Who believes not only in our globe with its sun and moon, but in other globes with their suns and moons,

  ---

  Who, constructing the house of himself or herself, not for a day but for all time, sees races, eras, dates, generations,
  The past, the future, dwelling there, like space, inseparable together.

</body>
</html>

Output:


<html>

  <head>

    <meta>

  </head>

  <body>


    <section>
      <p>Kosmos</p>
      <p>By Walt Whitman</p>
    </section>

    <section>
      <hr>
    </section>

    <section>
      <p>Who includes diversity and is Nature,</p>
      <p>Who is the amplitude of the earth, and the coarseness and sexuality of the earth, and the great charity of the earth and the equilibrium also,</p>
      <p>Who has not look’d forth from the windows the eyes for nothing, or whose brain held audience with messengers for nothing,</p>
    </section>

    <section>
      <p>Who contains believers and disbelievers, who is the most majestic lover,</p>
      <p>Who holds duly his or her triune proportion of realism, spiritualism, and of the æsthetic or intellectual,</p>
      <p>Who having consider’d the body finds all its organs and parts good,</p>
    </section>

    <section>
      <p>Who, out of the theory of the earth and of his or her body understands by subtle analogies all other theories,</p>
      <p>The theory of a city, a poem, and of the large politics of these States;</p>
    </section>

    <section>
      <p>Who believes not only in our globe with its sun and moon, but in other globes with their suns and moons,</p>
    </section>

    <section>
      <hr>
    </section>

    <section>
      <p>Who, constructing the house of himself or herself, not for a day but for all time, sees races, eras, dates, generations,</p>
      <p>The past, the future, dwelling there, like space, inseparable together.</p>
    </section>

  </body>

</html>

Example #2 (plain text)


Kosmos
By Walt Whitman

---

Who includes diversity and is Nature,
Who is the amplitude of the earth, and the coarseness and sexuality of the earth, and the great charity of the earth and the equilibrium also,
Who has not look’d forth from the windows the eyes for nothing, or whose brain held audience with messengers for nothing,

Who contains believers and disbelievers, who is the most majestic lover,
Who holds duly his or her triune proportion of realism, spiritualism, and of the æsthetic or intellectual,
Who having consider’d the body finds all its organs and parts good,

Who, out of the theory of the earth and of his or her body understands by subtle analogies all other theories,
The theory of a city, a poem, and of the large politics of these States;

Who believes not only in our globe with its sun and moon, but in other globes with their suns and moons,

---

Who, constructing the house of himself or herself, not for a day but for all time, sees races, eras, dates, generations,
The past, the future, dwelling there, like space, inseparable together.

Output


<section>
  <p>Kosmos</p>
  <p>By Walt Whitman</p>
</section>

<section>
  <hr>
</section>

<section>
  <p>Who includes diversity and is Nature,</p>
  <p>Who is the amplitude of the earth, and the coarseness and sexuality of the earth, and the great charity of the earth and the equilibrium also,</p>
  <p>Who has not look’d forth from the windows the eyes for nothing, or whose brain held audience with messengers for nothing,</p>
</section>

<section>
  <p>Who contains believers and disbelievers, who is the most majestic lover,</p>
  <p>Who holds duly his or her triune proportion of realism, spiritualism, and of the æsthetic or intellectual,</p>
  <p>Who having consider’d the body finds all its organs and parts good,</p>
</section>

<section>
  <p>Who, out of the theory of the earth and of his or her body understands by subtle analogies all other theories,</p>
  <p>The theory of a city, a poem, and of the large politics of these States;</p>
</section>

<section>
  <p>Who believes not only in our globe with its sun and moon, but in other globes with their suns and moons,</p>
</section>

<section>
  <hr>
</section>

<section>
  <p>Who, constructing the house of himself or herself, not for a day but for all time, sees races, eras, dates, generations,</p>
  <p>The past, the future, dwelling there, like space, inseparable together.</p>
</section>