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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mimid-client

v1.0.9

Published

Client library for mimid.io API

Readme

Client library for Mimid API

Node.js client library to access various API endpoints of the https://mimid.io service. The library uses API token that a valid user can obtain from the Mimid dashboard.

Using the library

First install the package with NPM or Yarn:

npm install mimid-client -s

After adding the package to your project, you can require it like this:

const mimid = require('mimid-client');

Setting the user token

The token can be set in the following way:

mimid.token(<TOKEN>);

It is also possible to set the token in an environment variable called MIMID_TOKEN:

export MIMID_TOKEN='<TOKEN>'

Creating a PDF

When you have an existing document on Mimid, you can get its ID from the URL when the document is open in the editor. You should also upload new CSV data that replaces the document default data.

Example:

const fs = require('fs');
const mimid = require('mimid-client');
const data = fs.readFileSync("./test-data.csv", 'utf8');

// Set the user token
mimid.token(process.env.MIMID_TOKEN);

(async () => {
  // Generate PDF
  const pdf = await mimid.pdf(process.env.MIMID_DOCUMENT_ID, data);
  fs.writeFileSync("./doc.pdf", pdf, "binary");
  console.log("Done creating PDF");
})();

Creating a text representation of the document

Exporting the document as text is almost identical to exporting a PDF. The biggest difference is that the call returns plain text.

Example:

const fs = require('fs');
const mimid = require('mimid-client');
const data = fs.readFileSync("./test-data.csv", 'utf8');

// Set the user token
mimid.token(process.env.MIMID_TOKEN);

(async () => {
  // Generate text
  const text = await mimid.text(process.env.MIMID_DOCUMENT_ID, data);
  fs.writeFileSync("./doc.txt", text, "utf8");
  console.log("Done creating text");
})();

Creating an image

Documents can be exported as PNG images. The current implementation tries to capture the area of the document that contains some visible content. The document margins are not included in the generated image (ie. the margin is always 0px).

Example:

const fs = require('fs');
const mimid = require('mimid-client');
const data = fs.readFileSync("./test-data.csv", 'utf8');

// Set the user token
mimid.token(process.env.MIMID_TOKEN);

(async () => {
  // Generate PNG image
  const image = await mimid.image(process.env.MIMID_DOCUMENT_ID, data);
  fs.writeFileSync("./doc.png", image, "binary");
  console.log("Done creating image");
})();

Exporting as HTML

The HTML export creates a simple HTML representation of the document. The HTML content does not include the styles or other properties that might have been set in the editor.

Following elements are supported:

  • Headings (converted to H1-H3)
  • Paragraphs (converted to p tags)
  • Links (converted to plain a tags)
  • Images (converted to img tags with the image data inlined in the src attribute)
  • Text formatting like b, i, u and strike.

The generated HTML also does not contain the surrounding tags like html or body. Only the content is being included as HTML tags.

Example:

const fs = require('fs');
const mimid = require('mimid-client');
const data = fs.readFileSync("./test-data.csv", 'utf8');

// Set the user token
mimid.token(process.env.MIMID_TOKEN);

(async () => {
  // Generate html
  const html = await mimid.html(process.env.MIMID_DOCUMENT_ID, data);
  fs.writeFileSync("./doc.html", html, "utf8");
  console.log("Done creating HTML");
})();

Exporting as Markdown

The Markdown export is based on the HTML export, so it supports the same content elements.

Headings use the atx style format.

Example:

const fs = require('fs');
const mimid = require('mimid-client');
const data = fs.readFileSync("./test-data.csv", 'utf8');

// Set the user token
mimid.token(process.env.MIMID_TOKEN);

(async () => {
  // Generate md
  const markdown = await mimid.markdown(process.env.MIMID_DOCUMENT_ID, data);
  fs.writeFileSync("./doc.md", markdown, "utf8");
  console.log("Done creating markdown");
})();

Converting arrays to CSV

The client library contains a utility function to convert array of arrays or array of object to CSV.

Example

// Convert array of arrays to CSV
var arrayData = [
  ["First item", "Second item"],
  ["Second row", "Second row second item"]
];

var arrayCsv = mimid.csv(arrayData);
console.log(arrayCsv);

// Convert array of objects to CSV
var objectData = [
  {name: "John Doe", age: 41},
  {name: "Jane Doe", age: 45}
];

var objectCsv = mimid.csv(objectData);
console.log(objectCsv);