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

tumblr-upload

v0.8.1

Published

Upload your Tumblr theme via node or CLI

Downloads

18

Readme

tumblr-upload

Upload your Tumblr theme via node or CLI

Build Status Coverage Status

Until now the only way to upload your custom theme to Tumblr was through their website, manually, by copying and pasting it into a form.

tumblr-upload lets you upload your theme via command line or in a node application (like gulp) using your Tumblr cookies as credentials.

Table of Contents

Install

$ npm install --save tumblr-upload

Setup

tumblr-upload simulates the press of the Save button in their backend, so it needs your own valid and current cookies. The cookie recovery process only takes a minute and it has to be done just once (per blog).

Getting your credentials

Cookies will be invalidated on logout, so it's suggested to do the following in an incognito window and to close it afterwards without logging out. Chrome was used for these steps:

  1. Go to edit your Tumblr theme
    1. Log into Tumblr
    2. Select your blog
    3. Open Customize
    4. Open Edit HTML >
  2. Save your theme with your developer tools open 4. Type anything to enable the Update preview button 5. Press the Update preview button 6. Open your browser developer tools 7. Open the Network tab and enable it if necessary 8. Press the Save button on the site
  3. You should see a POST request in the Network tab, select it
  4. Scroll to the bottom and copy the values of id and user_form_key Network tab, headers
  5. Visit the Cookies tab
  6. Copy the values of the cookies anon_id, pfe, pfp, pfs, and pfu

Using your credentials

You can specify these values in node, via command line, or in the tumblr-upload.ini file in your project root.

Sample tumblr-upload.ini

[my-special-tumblr]
	user_form_key: cqDwBjBTmy2oQHmyCFI574NNJQk
	anon_id: HTWJBOYOABHOFGDSLQIXNISORNJCVXSZ
	pfe: 1433542234
	pfp: ihx7GPOIpOm1YoVN1Np7awxBmbXdsz4rHDFPn6z4
	pfs: SpfJuvtJ5jxoDqCQ7qF1wA5mVdw
	pfu: 5252888
[my-other-tumblr]
	user_form_key: myCFI574NNJQkcqDwBjBTmy2oQH
	anon_id: DSLQIXNISORNJCVXSZHTWJBOYOABHOFG
	pfe: 4223414335
	pfp: p7awxBmbXdsz4rHDFPn6z4ihx7GPOIpOm1YoVN1N
	pfs: xoDqCQ7qF1wA5mVdwSpfJuvtJ5j
	pfu: 8885252

Usage

With tumblr-upload.ini project file

var tumblrUpload = require('tumblr-upload');
var fs = require('fs');
var template = fs.readFileSync('index.tumblr.html', 'utf8');

tumblrUpload(template, 'my-special-tumblr', function (err) {
	if (err) {
		console.error(err);
		return;
	}
	console.log('Uploaded!');
});

With credentials passed as an argument

var tumblrUpload = require('tumblr-upload');
var fs = require('fs');
var template = fs.readFileSync('index.tumblr.html', 'utf8');

var production = new tumblrUpload.Blog({
	tumblr_id: 'my-special-tumblr',
	user_form_key: 'cqDwBjBTmy2oQHmyCFI574NNJQk',
	anon_id: 'HTWJBOYOBBHOFGDSQQIXNISORNJCVXSZ',
	pfe: '1423532234',
	pfp: 'ihx7GPOIpOm1YoVN1Rq7awxBfbXdsz4rHDFPe6z4',
	pfs: 'SffJuvtJ5jxorRqCQ7qF1wT5mVdw',
	pfu: '5258845',
});

production.upload(template, function (err) {
	if (err) {
		console.error(err);
		return;
	}
	console.log('Uploaded!');
});

API

tumblrUpload(htmlTemplate, tumblr_id, callback)

This will upload the template using the credentials in tumblr-upload.ini in your project's root (or cwd).

Returns an http.ClientRequest object that can be .abort()'ed if necessary.

  • htmlTemplate - Tumblr template to upload (the actual theme text, not the filename)
  • tumblr_id - Your Tumblr ID (i.e. something in something.tumblr.com)
  • callback(err) - Function to call after the upload. Err will contain the error message, or it will be undefined if successful.

new tumblrUpload.Blog(credentials)

Type: constructor

  • credentials - Object or array previously-saved credentials. If array, follow this order: tumblr_id, user_form_key, anon_id, pfe, pfp, pfs, pfu

Returns an object with:

  • upload(htmlTemplate, callback) (function)
    • htmlTemplate - Tumblr template to upload (the actual theme text, not the filename)
    • callback(err) - Function to call after the upload. Err will contain the error message, or it will be undefined if successful.

CLI

$ npm install --global tumblr-upload

CLI examples

# Basic usage, will use tumblr-upload.ini
tumblr-upload my-special-tumblr index.tumblr.html

# Provide credentials on the fly, without relying on separate files
# Must be in the following order: tumblr_id,user_form_key,anon_id,pfe,pfp,pfs,pfu
tumblr-upload my-special-tumblr index.tumblr.html --credentials cqDwBjBTmy2oQHmyCFI574NNJQk,HTWJBOYOBBHOFGDSQQIXNISORNJCVXSZ,1423532234,ihx7GPOIpOm1YoVN1Rq7awxBfbXdsz4rHDFPe6z4,SffJuvtJ5jxorRqCQ7qF1wT5mVdw,5258845 

Options

--credentials

Specify comma-separed credentials, without spaces, in this order: tumblr_id,user_form_key,anon_id,pfe,pfp,pfs,pfu

--help

Show help screen

Legal

License: MIT © Federico Brigante

Tumblr trademarks belong to Tumblr, Inc

tumblr-upload is NOT affiliated with, endorsed, or sponsored by Tumblr.