🌸 A cli can automatically generate files from Excel files.

Overview

unxlsx

A cli can automatically generate files from Excel files.

NPM version

Why

We often need to export some information from XLSX to generate our files, such as multi-language, such as error message copywriting, such as project translation copywriting, when we need unxlsx to help us automatically generate

Features

  • Multiple xlsx support
  • Custom filed key support
  • Custom filed value support
  • Automatic generation of files if the file does not exist
  • Typescript support config file
  • support {} slot in the filed value

Usage

Install

pnpm add -D unxlsx

Config generate.config.ts

  • xlsxDir (require) : xlsx file directory base on process.cwd()

  • files (require) : all the files you want to generate

    • key (require) : the key in the xlsx file
    • value (require) : the value in the xlsx file
    • outPutFileDir (require) : the file you want to generate to
import { defineGenerateConfig } from 'unxlsx/utils'
export default defineGenerateConfig({
  xlsxDirs: [
    {
      xlsxDir: './xxx1.xlsx',
      files: [
        {
          key: 'key1',
          value: 'value1',
          outPutFileDir: './src/generate/file1.ts',
        },
        {
          key: 'key2',
          value: 'value2',
          outPutFileDir: './src/generate/file2.ts',
        },
      ],
    },
    {
      xlsxDir: './xxx2.xlsx',
      files: [
        {
          key: '后端接口错误码',
          value: '中文文案对照',
          outPutFileDir: './src/generate/file3.ts',
        },
        {
          key: '后端接口错误码',
          value: '英文文案',
          outPutFileDir: './src/generate/file4.ts',
        },
      ],
    },
  ],
})

Generate <fileName>.ts

pnpm run unxlsx

UseSlot Demo

  • EnTranslate was the object that describes the information in the xlsx file
  • EnTranslateKeys was the array that describes the EnTranslate keys
  • getEnTranslate you can get the value you want to use in the file
  • @/constant/EnTranslate was the directory of the generated file directory
  • above code all generated by unxlsx

In react jsx

import EnTranslate, { EnTranslateKeys, getEnTranslate } from '@/constant/EnTranslate'

//...
return (
    <>
      {/* normal use */}
      <p>
        {getEnTranslate(EnTranslateKeys.xxx1)}
      </p>
      {/* use slot */}
      <p>
        {getEnTranslate(EnTranslateKeys.xxx2, 'slot1', 'slot2')}
      </p>
    </>
)

Author

sudongyuer email:[email protected]

License

MIT License © 2021 SuDongYu

Comments
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • bb848ec: update slot support readme
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 235bd6c: feat: add slot support
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 9f77c7a: fix: unconfig dep
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • d7cb6b8: update README.md
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • b0e92e8: update
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • ae6e1ff: update package name
    opened by sudongyuer 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/changeset-version.yml (github-actions)
    • package.json (npm)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 7 Pull Requests:

    chore(deps): pin dependencies
    chore(deps): update dependency unbuild to v0.8.10
    • Schedule: ["at any time"]
    • Branch name: renovate/unbuild-0.x
    • Merge into: master
    • Upgrade unbuild to 0.8.10
    chore(deps): update dependency vitest to v0.22.1
    • Schedule: ["at any time"]
    • Branch name: renovate/vitest-0.x
    • Merge into: master
    • Upgrade vitest to 0.22.1
    chore(deps): update pnpm to v7.9.5
    • Schedule: ["at any time"]
    • Branch name: renovate/pnpm-7.x
    • Merge into: master
    • Upgrade pnpm to 7.9.5
    chore(deps): update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: master
    • Upgrade actions/checkout to v3
    chore(deps): update actions/setup-node action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-setup-node-3.x
    • Merge into: master
    • Upgrade actions/setup-node to v3
    chore(deps): update dependency vite to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/vite-3.x
    • Merge into: master
    • Upgrade vite to 3.0.9

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
Owner
Frozen FIsh
⊙﹏⊙‖∣° 🐟🐟🐟
Frozen FIsh
Mind Mapping to excel, or excel to .xmind file

Mind Mapping To Excel Project setup Prepare project npm install 1、Fetch data and generate excel Open the Mind Mapping like this Process On Mind Mappi

xuzelin995 3 May 5, 2022
✨ A cli can automatically export files of the same type

auto-export A cli can automatically export files Why When you want to export many files of the same type in one folder, you may cost a lot of time to

Frozen FIsh 22 Aug 11, 2022
🐼 A cli can automatically compress images with tinypng.com

easy-tinypng-cli A cli can automatically compress images with tinypng.com. Why When delevoping a website, we often need to compress images to reduce t

Frozen FIsh 58 Dec 14, 2022
An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor.

Obsidian Excel to Markdown Table An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor. Demo You can paste the copied Excel d

Ganessh Kumar 108 Jan 4, 2023
Excel-like Experience for Web Apps

DataGridXL 2 Excel-like Experience for Web Apps Built in JavaScript ES6. Made in the 2020s. ✅ Works with JSON ✅ Works with CSV ✅ Works with SQL ✅ Work

DataGridXL 381 Jan 2, 2023
FortuneSheet is an online spreedsheet component library that provides out-of-the-box features just like Excel

FortuneSheet FortuneSheet is an online spreedsheet component library that provides out-of-the-box features just like Excel English | 简体中文 Purpose The

Suzhou Ruilisi Technology Co., Ltd 1.6k Jan 3, 2023
Suplemento para Excel para auxiliar na elaboração de cálculos judiciais.

Getting Started with Create React App and Fluent UI This is a Create React App based repo that comes with Fluent UI pre-installed! Available Scripts I

null 4 Jul 6, 2022
Import flow for Excel (.xlsx) and CSV file with automated column matching and validation.

RSI react-spreadsheet-import ⚡️ A component used for importing XLS / XLSX / CSV documents built with Chakra UI. Import flow combines: ?? Uploader ⚙️ P

Ugnis 123 Dec 24, 2022
Export your HTML table to Excel format.

excelExport Export your HTML tables to Excel format. Doc Installation Simply import JQuery & excel-export into your HTML. <script src="https://code.jq

Zenoo 1 Apr 22, 2021
JavaScript library for parsing Dirtywave M8 files, complete with a CLI for interacting with M8 files.

m8-js This repository contains a JavaScript library for parsing Dirtywave M8 files, as well as a CLI for interacting with M8 files. The hopes are not

Jeremy Whitlock 20 Dec 17, 2022
Generate short video game music, automatically, endlessly.

short-VGM-generator (DEMO) Generate short video game music, automatically, endlessly. It is powered by machine learning with magenta.js HOW TO PLAY Pr

ABA Games 8 Oct 28, 2022
Automatically generate unit price for applicable items when shopping online.

Unit Price Helper Unit Price Helper is an Google Chrome extension that allows to display the prices per unit for the products on multiple shopping sit

Yang 6 Nov 18, 2022
Node-cli-starter - Basic starter kit for building Node CLI applications with TypeScript.

node-cli-starter Minimal starter kit for building Node CLI applications with TypeScript. Getting Started To get started clone repo locally and run npm

Cory Rylan 7 May 17, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
🦄 A CLI tool to quickly generate Next.js components

?? nextrate A CLI tool for quickly generating Next.js components. ✨ Features Automatically add the file type to the component name using the folder na

Kira 9 Aug 19, 2022
A simple CLI to generate a starter schema for keystone-6 from a pre-existing prisma schema.

Prisma2Keystone A tool for converting prisma schema to keystone schema typescript This is a proof of concept. More work is needed Usage npx prisma2key

Brook Mezgebu 17 Dec 17, 2022
A CLI tool to generate barrels with ease, efficiency, and intelligence

JS-Barrels A CLI tool to generate barrels with ease, efficiency, and intelligence Usage npx js-barrels -d ./folder/to/generate/barrels/for Options -d,

Snehil K 6 Aug 17, 2022