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

tablifier

v1.2.2

Published

Streamline table creation for your projects.

Downloads

48

Readme

Tablifier

npm version License: MIT

With Tablifier, you can effortlessly create tables from arrays of data, customize column headers, align content, and apply formatting options to suit your needs. Whether you're working on data visualization, reporting, or any other application requiring tabular representation, Tablifier offers a convenient solution to streamline your workflow. Say goodbye to tedious table formatting and let Tablifier handle the heavy lifting for you.

Features

  • TypeScript Support: Tablifier is written in TypeScript, ensuring type safety and compatibility with your project's codebase.
  • Customizable Headers: Easily customize column headers to suit your needs.

Instalation

npm install tablifier
pnpm add tablifier
yarn add tablifier
bun add tablifier

Usage

import { Table } from "tablifier"

const table = new Table("key", "value")
table.addRow("This is the key", "This is the value")

console.log(table.toString())
// output:
// ┌───────────────┬─────────────────┐
// │key            │value            │
// ├───────────────┼─────────────────┤
// │This is the key│This is the value│
// └───────────────┴─────────────────┘

console.log(table.toJSON())
// output:
// [{ key: 'This is the key', value: 'This is the value' }]

API Reference

new Table(...keys)

Initializes a new table instance with the provided header configuration.

keys: (string): The header keys of the table.

Example:

const table = new Table("key", "value")

table.addRow(...values)

By supplying the addRow function with the desired row data, users can effortlessly incorporate new information into their table structure.

values: ((null | undefined | string)[]): The row values to be added to the table.

Example:

table.addRow("This is the key", "This is the value")

table.toString()

Returns a string representation of the table.

Example:

console.log(table.toString())
// output:
// ┌───────────────┬─────────────────┐
// │key            │value            │
// ├───────────────┼─────────────────┤
// │This is the key│This is the value│
// └───────────────┴─────────────────┘

table.toJSON()

Returns a JSON representation of the table.

Example:

console.log(table.toJSON())
// output:
// [{ key: 'This is the key', value: 'This is the value' }]

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request. Here are some ways you can contribute:

  • Bug Reports: If you find any bugs or unexpected behavior, please open an issue describing the problem.
  • Feature Requests: If you have ideas for new features or improvements, feel free to suggest them by opening an issue.
  • Code Contributions: Contributions to the codebase via pull requests are highly appreciated. Before submitting a pull request, please make sure to follow the contribution guidelines below.

Contribution Guidelines

  1. Fork the repository and clone it to your local machine.
  2. Create a new branch for your feature/fix: git checkout -b feature-name.
  3. Make changes and test them thoroughly.
  4. Ensure that your code follows the existing code style and conventions.
  5. Update the README and documentation if necessary.
  6. Commit your changes with descriptive commit messages.
  7. Push your branch to your fork: git push origin feature-name.
  8. Open a pull request to the main branch of the original repository.

Thank you for contributing to Tablifier!

License

This project is licensed under the MIT License - see the LICENSE file for details.