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

node-tilify

v1.0.6

Published

Today I Learned tool that converts text file or a directory of text files to HTML files

Downloads

6

Readme

Node-TILify

Welcome to Node-TILify. An open source CLI software that helps you convert a text file or a directory of text file(s) into html file(s) blazingly fast 🏃‍♂️ 💨 ⚡️. The name of the project was chosen to showcase which language/framework was used to build this tool -- Node.js, what the tool is all about -- TIL - Today I Learned, & the value that it adds to your workflow -- Amplifying Knowledge.

How to install

Make sure you have latest node installed on your computer.

To install this program globally on your machine, run the command:

npm i -g node-tilify

You can now run the program to see how to use this tool:

node-tilify -h

Features

  • Pass in a txt file and it'll generate an html file.
  • Pass in a directory and it'll search through all the txt files in that directory and generate html files which are then stored in ./til directory.
  • Every paragraph is enclosed with <p> tag.
  • Every hyperlink starting with https:// or http:// is enclosed with <a> tag.
  • Every line that ends in ^ is enclosed in <h2> tag.
  • Optional Feature #1: If the first line of the text has 2 spaces after it, a <title> tag is added to the <head> and a <h1> tag is added at the beginning of <body>.
  • Optional Feature #5: Stylesheet is added to every html file to improve the looks of it.
  • Passing -h or --help command prints help menu.
  • Passing -v or --version command prints version and name of the tool.
  • Optional Feature #2: Passing -o or --output command followed by an output directory path, stores all the generated HTML files to that directory. If no directory exists, it'll create one. It overwrites the content of the files that match with the input file or directory of files and creates a new file if it doesn't exist in the output directory.
  • Name of the generated html file is the same as name of txt file.
  • Converts Markdown horizontal lines to HTML horizontal lines.
  • Converts Markdown links to HTML links.
  • Converts Markdown images to HTML images.
  • TOML Configuration: Instead of repeatedly passing in command-line arguments, you can now set your preferences in a TOML configuration file. Use the -c or --config flags followed by the path to your TOML configuration file.

Usages / Examples

  • node-tilify -h / node-tilify --help - To print help menu
  • node-tilify -v / node-tilify --version - To print version and name of the tool
  • node-tilify input.txt - To read txt file and generate html from it to be stored in ./til directory
  • node-tilify ./examples - To read txt files from a directory and generate html from it to be stored in ./til directory
  • node-tilify input.txt -o collection / node-tilify input.txt -output collection - To read a txt file and generate html from it to be stored in ./collection directory
  • node-tilify ./examples -o collection / node-tilify ./examples --output collection - To read txt files from a directory and generate html from it to be stored in ./collection directory
  • node-tilify --config path_to_your_config.toml / node-tilify -c path_to_your_config.toml- To utilize your configuration file settings for conversion.

Usages / Examples (with Output)

To generate multiple HTML files from a directory with your preferred output directory:

Command Line:

sohamthaker@Sohams-MacBook-Pro Node-TILify % node-tilify examples -o output
HTML files generated successfully stored at output!

partial output of examples/Kubernetes101.txt

Kubernetes 101


TIL about Kubernetes, Google’s open source container orchestration system.

I spent a half-day at Google’s office space today learning about Kubernetes from the folks at Apprenda. Going in to the session, I thought I had a grasp on what Kubernetes was, but quickly realized I had many misconceptions.

We worked through the following repository, provided by Apprenda, for learning some of the basics of Kubernetes: https://github.com/apprenda/hands-on-with-kubernetes-gke.

Here are some things that I learned from the session:

Kubernettes !== Docker^

I thought Kubernetes was just a different way to build container images like you can with Docker… not so!

Kubernetes is a container orchestration system: in other words, it provides the necessary components for configuring, deploying and scaling images that are built with Docker.

partial output of output/Kubernetes101.html

<!DOCTYPE html>
    <html lang="en-us">
    <head>
      <meta charset="utf-8">
      <link rel=stylesheet href=https://cdn.jsdelivr.net/npm/water.css@2/out/water.css>
      <title>Kubernetes 101</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body>
     <h1>Kubernetes 101</h1>

     <p>TIL about Kubernetes, Google’s open source container orchestration system.</p>

     <p>I spent a half-day at Google’s office space today learning about Kubernetes from the folks at Apprenda. Going in to the session, I thought I had a grasp on what Kubernetes was, but quickly realized I had many misconceptions.</p>

     <p>We worked through the following repository, provided by Apprenda, for learning some of the basics of Kubernetes: <a href="https://github.com/apprenda/hands-on-with-kubernetes-gke." target="_blank">https://github.com/apprenda/hands-on-with-kubernetes-gke.</a></p>

     <p>Here are some things that I learned from the session:</p>

     <h2>Kubernettes !== Docker</h2>

     <p>I thought Kubernetes was just a different way to build container images like you can with Docker… not so!</p>

     <p>Kubernetes is a container orchestration system: in other words, it provides the necessary components for configuring, deploying and scaling images that are built with Docker.</p>

Configuration Using TOML

Now with TOML configuration support, streamline your repetitive tasks by setting your configurations just once!

How to Use

  1. Create a .toml file with your desired configuration. Here's an example format:
# This is a sample TOML configuration file
input = "./src"

# Output directory where generated files will be saved
output = "./build"

# Stylesheet URL
stylesheet = "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"

# Language setting
lang = "fr"
  1. Run the following command:
node-tilify -c path_to_your_config.toml
  1. That's it! Your files will be generated in the output directory you specified in your configuration file.