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

mc.uploader

v0.1.10

Published

A cli tool to upload content with frontmatter to contentful

Downloads

37

Readme

Mc Uploader (Markdown Contentful Uploader)

Mc Uploader in the house!

A tool to upload markdown files with frontmatter to contentful. This is the first release, if you find an issue or would like a feature added, please open an issue.

Features

  • Validates your data against your contentful content type before it uploads.
  • Rate limits requests according to contentful rate limit.
  • Transform your data with a mapper before you upload to contentful.

Installation

Install like so:

npm install mc.uploader

Usage

There are two ways to use mc.uploader. With or without a config file. Without a config file you pass in all parameters with command line arguments like so:

mc.uploader -t <token> -s <space-id> -c <content-type> <glob>

For convenience you can also a config file

mc.uploader -C <my-config-file.json> <glob>

Options

To get all available options, simply go

mc.uploader --help

That'll print out the cli help:

  Options:

    -h, --help                         output usage information
    -V, --version                      output the version number
    -C --config [config]               Your settings file (.json), will override any other settings you pass in
    -t, --token <token>                Your contentful api token
    -l, --lang [lang]                  The language setting for this content, defaults to en-US
    -m, --mapper [mapper]              You can pass in a mapper file (.js) which has to export one function which can be used to map over the imported data
    -c, --content-type <content-type>  Id for the contentful content type. You need this so that contentful knows which content type to use for these entries
    -s --space-id <space-id>           Id of the contentful space that you want to upload the entries to.
    -p, --publish                      Whether or not to publish your uploaded entries immediately

Here's how a config.json file would look:

{
  "token": "(required) Your contentful oauth token",
  "spaceId": "(required) Your contentful space id (required)",
  "contentType": "(required) The name of your content type - like blogPost or teamMember",
  "publish": "true - publishes the entries after they are created, don't configure this if you don't want to publish, defaults to false",
  "lang": "The locale that you want to use for this content, defaults to 'en-US'",
  "mapper": "Path to mapper file. You can use this to prepare entries for upload"
}

Mappers

Use a mapper if you need to modify your data before uploading it to contentful.

For example, let's say you want to use the file names to populate a field called 'slug' before you send the data to contentful. You can use a mapper to do that.

All you need to do is create a module that exports a function, this function gets used for all the entries before they get uploaded:

module.exports = function(file) {
  file.content.fields.slug = {
    'en-US': file.path.replace('.md', '')
  };
  return file;
};

Use the mapper by specifying the mapper option like so: mc.upload -m add-slug.js .....

The file object that gets passed to the mapper function looks like this:

{
  path: 'blog-post.md',
  content: {
    fields: {
      title: {
        'en-US': 'Hey there this is a blo post'
      },
      body: {
        'en-US': 'And this is the blog post body'
      }
    }
  }
}

And when it has run through the mapper it'll look like this

{
  path: 'blog-post.md',
  content: {
    fields: {
      title: {
        'en-US': 'Hey there this is a blo post'
      },
      body: {
        'en-US': 'And this is the blog post body'
      },
      slug: {
        'en-US': 'blog-post'
      }
    }
  }
}

Where do I find all the contentful settings?

  • Where do I find my token? You can find out about getting a contentful oauth token here. To get your space id, simply look at your api settings.
  • Where do I find my space id? You can look at the url when you're logged into contentful - it'll look something like https://app.contentful.com/spaces/<your-space-id>
  • __What's the

This is the simplest way to use mc.uploader

mc.uploader -t <token> -s <space-id> -c <content-type> <glob>