npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@silencesys/xlsx-to-xml

v1.0.3

Published

Export XLSX files to XML

Downloads

4

Readme

XLSX to XML

This little tool converts two column XLSX Excel files to XML.

How to use

  1. Install this package with NPM
npm install -g @silencesys/xlsx-to-xml
  1. Create config file that will be used for the transformation
  2. Run the tool
xlsx-to-xml --input your_input_file.xlsx --output your_output_file.xml --config your_config.json

Available options

| Option | Description | | ------ | ----------- | | --input, -i | The input file to be converted to xlsx | | --output, -o | The output file to be created | | --config, -c | The config file that will be used | | --dirty | Set this flag if you want to see XHTML tags added by XLSX transformer | | --ignore-halves | Set this flag if you want to ignore rows that has one column empty | | --help, -h | Show help |

Config file

The config file is a standard JSON file with following structure:

{
  "parentTagName": "dictionary",
  "rowTagName": "entry",
  "language": ["eng", "cze"],
  "stripTags": [
    "<span style=\"font-size:12pt;\">"
  ],
  "replaceTags": [
    {
      "from": "<span style=\"font-size:9pt;\">",
      "to": "<note>"
    },
  ],
  "divideBy": [
    [": "]
  ]
}

As you can see there are several options that can be used. There is no default config file as each use case is expected to be unique. You can use aforementioned snippet as your default config file.

| Option | Required | Description | | ------ | :--: | ----------- | | parentTagName | Yes | Name of the parent tag. | | rowTagName | Yes | Name of the row tag. | | language | Optional | List of languages that should be used. | | stripTags | Optional | List of tags that should be stripped from the text. The list should contain only opening tags with all their attributes that should be removed. | | replaceTags | Optional | List of tags that should be replaced. These tags should always be defined as a JSON object containing keys from and to. Only opening tags but with all attributes should be defined there. | | divideBy | Optional | List of strings that should be used to divide the text. You might want to include spaces following after these characters as the division method is quite dumb. |

How to write a config file

I'm sure you ask how am I supposed to know which XHTML tags will be used in my XLSX document after conversion. Well, for that purpose there is a very simple way. Just run following command:

xlsx-to-xml --input your_input_file.xlsx --dirty

This will output a dirty file containing XML with all XHTML tags. You can then decide which tags should be stripped or replaced and which should be kept. Just keep in mind that tags <dirty-list> and <dirty-row> are added by this tool and will be replaced by parentTagName and rowTagName respectively.

Contributing

All the code is open source and you can contribute to the project by creating pull requests.

License

This project is licensed under the MIT license.