excel

Docs › Start

Getting started

Add one CDN line or the npm package, then call the functions or drop in the form component.

82excel is a free (MIT) library that reads xlsx, xls and csv files in the browser or Node and checks them against header rules. Its one runtime dependency is fflate, and files and their contents never leave the browser.

Two ways to use it

  • Functions only (script): call Excel82.inspect / check / readRows / rulesFromTemplate / makeTemplate yourself, from the CDN global, from import { … } from '82excel', or in Node. No UI.
  • The drag-and-drop form component <excel-82>: a web component with file picking, results, preview and upload. Rules are plain HTML attributes.

From the CDN

This is the jsDelivr URL; pin the version in production. The same file is at https://82excel.com/cdn/v0.1.0/82excel.min.js. The script defines the global Excel82, registers <excel-82> and includes the Korean messages. The ESM build is 82excel.esm.js in the same folder.

<script src="https://cdn.jsdelivr.net/npm/82excel@0.1.0/dist/cdn/82excel.min.js"></script>

Way 1: functions only

<script src="https://cdn.jsdelivr.net/npm/82excel@0.1.0/dist/cdn/82excel.min.js"></script>

<input type="file" id="f">
<script>
  document.getElementById('f').onchange = async (e) => {
    const r = await Excel82.check(e.target.files[0], {
      headers: ['Name', 'Phone', 'Amount'],
    });
    console.log(r.ok, r.errors);
  };
</script>

Way 2: the form component

<script src="https://cdn.jsdelivr.net/npm/82excel@0.1.0/dist/cdn/82excel.min.js"></script>

<form action="/save" method="post">
  <excel-82 name="excel" required headers="Name,Phone,Amount" min-rows="1"
            accept="xlsx,xls,csv" upload="/api/upload"></excel-82>
  <button>Submit</button>
</form>

From npm

npm i 82excel
import { check } from '82excel';   // functions only; no DOM, so it imports in Node too
import '82excel/element';           // registers <excel-82> (browser)
import '82excel/locales/ko';        // Korean messages (locale: 'ko')
EntryWhat it is
82excelFunctions only (inspect, check, readRows, rulesFromTemplate, makeTemplate, registerLocale, VERSION). Works in Node
82excel/elementThe <excel-82> web component, registered on import (idempotent). Call defineExcelElement('my-excel') for an extra tag name. Includes Korean messages
82excel/locales/koKorean messages
82excel/cdn/*CDN builds (82excel.min.js IIFE, 82excel.esm.js)

Next