@wildhog/consolas

1.0.3 • Public • Published

Welcome to ConsolAS - the library with the missing `console` methods for Google Apps Script 👋

Version License: MIT

Adds useful Console methods to Google Apps Script

Getting Started

As a Google Apps Script Library

Import the following script ID as a library into your Google Apps Script project:

18Wk4wG7DGRGvy39zZbWhkU37z6ytqW06QkSwUlZHlIClQXHmCtEFucvD

Initiate ConsoleAS:

const cx  = ConsoleAS.init();

As an NPM module

Install by running:

npm i @wildhog/consolas

Import and initiate ConsolAS:

import { ConsolAS } from 'consolas';
const cx = new ConsolAS();

By Copying and Pasting the Code from the dist/copy-paste/consolas.js File

The IIFE in the dist/copy-paste/consolas.js returns a class and stores it in the ConsolAS variable. Hence you only need to initiate the said class:

const cx = new ConsolAS();

API

ConsolAS works with two-dimensional arrays and objects.

Example 1:

cx.table([
  ['Name', 'Profession'],
  ['John Doe', 'Developer'],
  ['Jane Doe', 'Designer'],
  ['Jim Doe', 'Artist'],
]);

This prints out:

| (index) | 0        | 1          |
| ------- | -------- | ---------- |
| 0       | Name     | Profession |
| 1       | John Doe | Developer  |
| 2       | Jane Doe | Designer   |
| 3       | Jim Doe  | Artist     |

Example 2:

cx.table({
  name: 'John Doe',
  profession: 'Developer',
  age: 30,
  city: 'Anytown',
});

This prints out:

| (index)    | Value     |
| ---------- | --------- |
| name       | John Doe  |
| profession | Developer |
| age        | 30        |
| city       | Anytown   |

Supported Methods

Currently only the table(TwoDimArray|Object) method works. Other methods will follow soon.

Run tests

npm t

Author

👤 Dmitry Kostyuk | Wurkspaces.dev

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

Package Sidebar

Install

npm i @wildhog/consolas

Weekly Downloads

14

Version

1.0.3

License

MIT

Unpacked Size

41.8 kB

Total Files

29

Last publish

Collaborators

  • wildhog