verttext

A node package which converts horizontally-aligned text to a vertical one.

Usage no npm install needed!

<script type="module">
  import verttext from 'https://cdn.skypack.dev/verttext';
</script>

README

verttext

verttext is a node module which converts horizontally-aligned text to a vertical one. This module may be useful for East-Asia languages like Chinese and Japanese.

Usage

verttext(string: text, integer: number of characters per line, string: separator, integer: number of separator)

Example

In index.js

var vt = require("verttext");

vt.verttext("根據羅馬神話,羅馬的建城日是公元前753年4月21日[5],距今已有2700多年的歷史,是由一對被母狼餵哺養大的雙胞胎羅穆盧斯和瑞摩斯建立的[6],最初建在景色秀麗的七座山丘之上,因此稱為「七丘之城」。", 30, " ", 1);

The function returns a piece of vertically aligned text. Each line has 30 characters and is separated by one " " (space) from other lines.

Source of the piece of text above: Wikipedia