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

reason-console-formatter

v1.4.0

Published

Makes ReasonML types more readable when they are logged to the console

Downloads

172

Readme

ReasonML Console Formatter

Transforms ReasonML types to a readable format when they are logged to the Chrome console or NodeJS console.

Status: ⚠️ Doesn't work with all the types. Only Lists & nested Lists, for now 🤘

CircleCI

Install as a module (recomended)

You can install it on your application or your library via npm/yarn.

npm install reason-console-formatter --dev
# or yarn
yarn add reason-console-formatter --dev
[@bs.module "reason-console-formatter"]
external install: unit => unit = "default";

install();

Install as a chrome extension

Add it to your Chrome: https://chrome.google.com/webstore/detail/reasonml-formatter

Usage

You need to enable Custom Formatters in the DevTools settings in order to have this working.

Step 1: Open DevTools settings

Step 2: Enable custom formatters

Note: You might need to refresh the page first time you open Console panel with existing logs - custom formatters are applied only to newly printed console messages.

How it works

Detects at runtime what kind of data structures are you logging into the console and maps them to ReasonML types.

Right now, BuckleScript has a debug flag ("-bs-g") that labels some of the types with some JavaScript Symbols that can be catched by this extension and pretty prints them:

This is the output of the tests, the future of this extension. Right now, you can take a look at test/bs-demo/README.md to get a better idea on what's keeping us to implement that! Thanks! 😄

Right now bs-g, aside from the labeling does a little bit of formatting as well. The down-site is that it contains a lot of bugs and isn't something easy to refactor. @bobzhang said that this part of Bucklescript's source code is a mess.

The idea is to create a extension that delivers a great developer experience that could replace at some point the flag and extract that debug logic from BuckleScript.

If you want to know more about this check test/bs-demo/README.md or DM me on the discord.

If you miss some type that you thing would be helpful, let me know, by opening a new Issue!

Development

  1. Clone this repo
  2. $ yarn - Install dependencies
  3. $ yarn dev - Compile
  4. $ cd test/BuckleScript - Go to a demo page
  5. $ yarn - Install dependencies of the demo
  6. (new tab) $ yarn start - Start the server
  7. (new tab) $ yarn watch - Compile Reason code
  8. Open "localhost:1234"

Credit

Based on immutable-devtools and inspired by the awesome cljs-devtools.