Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielcsapo/turtler
🐢 Ascii tables made easy
https://github.com/gabrielcsapo/turtler
ascii javascript table utility
Last synced: 20 days ago
JSON representation
🐢 Ascii tables made easy
- Host: GitHub
- URL: https://github.com/gabrielcsapo/turtler
- Owner: gabrielcsapo
- License: apache-2.0
- Created: 2017-12-20T06:17:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-27T04:49:26.000Z (over 5 years ago)
- Last Synced: 2024-10-13T20:44:45.404Z (24 days ago)
- Topics: ascii, javascript, table, utility
- Language: JavaScript
- Homepage: https://gabrielcsapo.github.io/turtler
- Size: 357 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# turtler
> 🐢 Ascii tables made easy
[![Npm Version](https://img.shields.io/npm/v/turtler.svg)](https://www.npmjs.com/package/turtler)
[![Build Status](https://travis-ci.org/gabrielcsapo/turtler.svg?branch=master)](https://travis-ci.org/gabrielcsapo/turtler)
[![Coverage Status](https://lcov-server.gabrielcsapo.com/badge/github%2Ecom/gabrielcsapo/turtler.svg)](https://lcov-server.gabrielcsapo.com/coverage/github%2Ecom/gabrielcsapo/turtler)
[![Dependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/turtler/status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/turtler)
[![devDependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/turtler/dev-status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/turtler#info=devDependencies)
[![npm](https://img.shields.io/npm/dt/turtler.svg)]()
[![npm](https://img.shields.io/npm/dm/turtler.svg)]()## Installation
```
npm install turtler --save
```## Usage
> the given options are the defaults
```javascript
let table = new Turtler([
["uid", "name"],
["1", "Doe"],
["2", "Hemma"]
], {
hasHeader: true,
columnSeparator: ' | ',
headerSeparator: '='
});console.log(table);
```This will yield:
```
uid | name
===========
1 | Doe
2 | Hemma
```### Markdown
> We can also output markdown tables just as easily
```javascript
let table = new Turtler([
["uid", "name"],
["1", "Doe"],
["2", "Hemma"]
]);console.log(table.markdown());
```This will yield:
```
| uid | name |
|-----|-------|
| 1 | Doe |
| 2 | Hemma |
```### Html
> We can also output html tables just as easily
```javascript
let table = new Turtler([
["uid", "name"],
["1", "Doe"],
["2", "Hemma"]
]);console.log(table.html());
```
This will yield:
```html
uid
name
1
Doe
2
Hemma
```