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

typeble

v0.5.0

Published

Unofficial Tumblr API JS library written in Typescript

Downloads

5

Readme

Typeble

GitHub Workflow Status codecov GitHub GitHub search hit counter

Typeble is an unofficial Tumblr API library written entirely in typescript to fill the gap left by the official Tumblr JS lib that doesn't supply type information nor seems to support the OAuth2 standard. It's still heavily WIP, but many of the important endpoints of the API are covered.

⚠️ Notice ⚠️

This library is NOT official, endorsed, sponsored by, or otherwise associated with Tumblr in any way, shape, or form.

It was built using the API reference documents, and like any other project built using the API (including those made using this library) should conform to the Tumblr Application Developer and API License Agreement. Be sure you also follow it.

How to use

  1. Install the package into your project with NPM with the command npm install typeble
  2. Import the functions you need for your project as you would any library, documentation here
  3. Obtain an OAuth 2 token for tumblr using my tumblr authentication library or some other method
  4. DON'T SHARE THE TOKEN WITH ANYONE! It will expire (unless it has the offline_access scope) but someone could do damage to your account if they get access to the token
  5. Pass the token as the first argument to any of the functions

Contributing

First and foremost, once again, make sure to honour the Tumblr Application Developer and API License Agreement. Don't try to bypass any rate limits, and make sure that this project isn't in any way percievable as officially endorsed by Tumblr.

Code that is not documented, is poorly documented, or is "hacky" in some way, especially parts close to the API, will likely not be added to the codebase. Code that isn't at least somewhat covered by unit tests is heavily discouraged.

Testing (Local)

Create a .env file with the following contents (You can also just set them as environment variables, but afaik that's less secure):

CONSUMER_ID=[your Tumblr OAuth App ID here]
CONSUMER_SECRET=[your Tumblr OAuth App secret here]

Then run npm test. A browser window will open up a Tumblr authentication page, asking you to approve the scopes. REMEMBER THAT THE TESTS WILL BE RUN USING WHATEVER ACCOUNT YOU ARE LOGGED INTO! Create a bot account if you need to.

Testing (Github)

Truth be told, CI (tests) will likely only run on master as there is a chance of destructive actions being taken using the bot used for testing. If you want to run CI on your own fork, be sure to set the following github secrets:

  • SECRETS_ACCESS_TOKEN: A github PAT (can be fine-grained) with write access to your fork's secrets (used to update the refresh token)
  • TUMBLR_CLIENT_ID: The client ID from your Tumblr OAuth App (Can just be a normal environment variable, but oh well)
  • TUMBLR_CLIENT_SECRET: The client secret from your Tumblr OAuth App
  • TUMBLR_REFRESH_TOKEN: A refresh token from a successful login to a Tumblr OAuth App with the offline_access scope, you can use my tumblr authentication library from the command line with the scope parameter set to include offline_access and the json option set to get the full response (which includes the refresh token). REMEMBER THAT THE RUN USING WHATEVER ACCOUNT YOU ARE LOGGED INTO! You really want to use a bot account for this, since if you accidentally merge malicious code, it could run on your main account.

Roadmap

  • [ ] Cover all (documented) endpoints
  • [x] Add support for OAuth1/plain access token authentication where possible
  • [x] Release on NPM
  • [ ] Starter template using this project

Other Resources