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

@seth-brown/formd

v2.0.5

Published

A Markdown CLI formatting tool

Downloads

2

Readme

formd: a markdown formatting tool

Build Status

formd is a CLI tool for (for)matting (m)ark(d)own that allows interconversion between the two styles of Markdown links, inline and referenced. The tool conforms to the Github Flavored Markdown spec.

Installation

npm install -g @seth-brown/formd

If the default location npm installs packages to isn't in your path, you may need to add it to your path. For example:

echo 'export PATH="$HOME/.node/bin:$PATH"' >> ~/.zshrc

Motivation

Inline Markdown is difficult to read, but useful for writing and editing because the linked text and URLs are adjacent to the words you are writing. For example:

The quick brown [fox](http://en.wikipedia.org/wiki/Fox) jumped over the lazy [dog](http://en.wikipedia.org/wiki/Dog).

Referenced Markdown is awkward while writing because it requires jumping between links within the text and the reference section of the document. However, referenced Markdown is the superior syntax for reading because URLs do not breakup the flow of words or sentences. For example:

The quick brown [fox][1] jumped over the lazy [dog][2].

formd provides the best of both worlds by allowing users to quickly toggle Markdown formats between inline while writing and referenced while reading. formd reads and writes to standard streams, so it can be adapted to a wide-range of user workflows.

Usage

formd is a command line tool, but its primary use case is with text editors or in conjunction with system tools like snipper expanders or app launchers. From the command line formd can be used as follows:

For help:

formd -h

To generate referenced Markdown use the -r flag:

formd -r < <(echo "a line of text\na link with a [link]('www.foo.com')")

To generate inline Markdown use the -i flag:

cat my-markdown.md | formd -i

Usage with Text Editors

formd can be integrated with editors like Vim. The easiest option is to call it directly from within a Vim buffer. For example:

:%! formd -r

An easier approach is to use a function to execute formd and return the cursor back to it's original position within the buffer.

" a function to execute `formd` and return the cursor back
" to it's original position within the buffer. 
" This script assumes `formd` is in your path. 
function! Formd(option)
    :let save_view = winsaveview()
    :let flag = a:option
    :if flag == "-i"
        :%! formd -i
    :else
        :%! formd -r
    :endif
    :call winrestview(save_view)
endfunction
 
" formd mappings 
nmap <leader>fr :call Formd("-r")<CR>
nmap <leader>fi :call Formd("-i")<CR>

Usage with App Launchers

formd can be invoked with app launchers like Alfred. Two Alfred workflows are provided in the repo at system/alfred/. These workflows take the contents from the clipboard and covert them to either inline or reference markdown and then paste the converted text into the front most application.

Release History

  • 1.0.0 Initial release
  • 2.0.0 Ported library to Typescript/Node