@shogo82148/a1notation
v0.2.2
Published
A TypeScript library for parsing and generating A1 notation (e.g. Sheet1!A1:B2) used in spreadsheets like Excel and Google Sheets.
Readme
a1notation
A TypeScript library for parsing and generating A1 notation (e.g.
Sheet1!A1:B2) used in spreadsheets like Excel and Google Sheets.
Usage
Parsing A1 Notation
import { A1Notation } from "@shogo82148/a1notation";
const a1 = A1Notation.parse("Sheet1!A1:B2");
console.log(a1.sheetName); // "Sheet1"
console.log(a1.left); // 1
console.log(a1.top); // 1
console.log(a1.right); // 2
console.log(a1.bottom); // 2Generating A1 Notation
import { A1Notation } from "@shogo82148/a1notation";
const a1 = new A1Notation("Sheet1", 3, 2);
console.log(`${a1}`); // Sheet1!C2