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 🙏

© 2025 – Pkg Stats / Ryan Hefner

autometa

v0.0.9

Published

Generate various data from Excel spreadsheet

Readme

autometa NPM version Build Status

Generate various data from Excel spreadsheet.

Overview

overview

  1. Extract "A1" cell value as "Template ID" from each Excel worksheet
  2. Extract all cells value according to [Template ID].csv
  3. Embed these values into [Template ID].ejs
  4. Save as FileName specified in an Excel worksheet

Installation

via npm (node package manager)

$ npm install -g autometa

Examples

Basic example

Generate data from note-example.xlsx as mentioned in the overview above.

$ autometa note-example.xlsx

Horizontal repetitive elements example

Generate data from Excel spreadsheet includes an element repeated horizontally.

$ autometa test-repeat.xlsx

test-repeat.xlsx

test-repeat.xlsx

catalog.csv

FileName,B2
Title,B3
Artist,B4
Country,B5
Company,B6
Price,B7
Year,B8

catalog.ejs

<CATALOG>
<% for (i=0; i<Title.length; i++) { -%>
  <CD>
    <TITLE><%- Title[i] %></TITLE>
    <ARTIST><%- Artist[i] %></ARTIST>
    <COUNTRY><%- Country[i] %></COUNTRY>
    <COMPANY><%- Company[i] %></COMPANY>
    <PRICE><%- Price[i] %></PRICE>
    <YEAR><%- Year[i] %></YEAR>
  </CD>
<% } -%>
</CATALOG>

Vertical repetitive elements example

Generate data from Excel spreadsheet includes an element repeated vertically.

test-repeat2.xlsx

test-repeat2.xlsx

catalog-v.csv

FileName,A2
Title,A4
Artist,B4
Country,C4
Company,D4
Price,E4
Year,F4

catalog-v.ejs (same as catalog.ejs)

<CATALOG>
<% for (i=0; i<Title.length; i++) { -%>
  <CD>
    <TITLE><%- Title[i] %></TITLE>
    <ARTIST><%- Artist[i] %></ARTIST>
    <COUNTRY><%- Country[i] %></COUNTRY>
    <COMPANY><%- Company[i] %></COMPANY>
    <PRICE><%- Price[i] %></PRICE>
    <YEAR><%- Year[i] %></YEAR>
  </CD>
<% } -%>
</CATALOG>

Horizontal and vertical repetitive elements

Of course, you can generate data from Excel spreadsheet includes elements repeated horizontally and vertically.

Multiple worksheets

You can get data from each worksheet of Excel spreadsheets.

Templates directory

Autometa search templates ([Template ID].csv and [Template ID].ejs) in the current directory of input file first.
If templates not found, search default templates directory ([autometa package directory]/templates).
If you want to add templates directory, set AUTOMETA_TEMPLATES environment variable.

$ export AUTOMETA_TEMPLATES="/path/to/your/templates"

Original Templates

If you want to define original templates, create [Template ID].csv, [Template ID].ejs and place these files in the templates directory.
You can use ect templates ([Template ID].ect) instead of ejs templates. If both ejs and ect templates exist, autometa will use ejs.

You can also place templates by register option (-r or --register-templates).

$ autometa -r [Template ID].ejs [Template ID].csv
$ Register success: [Template ID].ejs placed on [templates directory]
$ Register success: [Template ID].csv placed on [templates directory]

Set a filename manually

If you want to set a filename of first sheet manually, use -o, --output option.

$ autometa -o /path/to/your/filename note-example.xlsx

If specified filename is "/dev/stdout" or "-", autometa place output on stdout.

$ autometa -o /dev/stdout note-example.xlsx

When you use this option, Excel worksheet's FileName is ignored.

Set a Template ID manually

If you want to set a Template ID manually, use -t, --set-template-id option.

$ autometa -t your-template-id note-example.xlsx

When you set this option, Excel worksheet's Template ID is ignored.

Usage manual

$ autometa -h
  Usage: autometa [options] <Excel spreadsheet>

  Options:

    -h, --help                           output usage information
    -v, --version                        output the version number
    -f, --force                          overwrite existing files
    -p, --print-templates-dirs           print templates directories
    -o, --output                         set output file name of first
                                         sheet manually
    -r, --register-templates <files>     register template files
    -t, --set-template-id <Template ID>  set a Template ID manually

Environment variable:
AUTOMETA_TEMPLATES         Set ":"-separated list of directories,
                           if you want to change templates directory.

Dependencies

commander, ect, ejs, xlsjs, xlsx, readline-sync

References

Example data in reference to XML Examples

License

Copyright © 2014-2016 Kenji Doi (knjcode)
Licensed under the Apache License, Version 2.0