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

oauth-node

v1.0.3

Published

This project provides a JavaScript-based solution to automate the process of obtaining and renewing OAuth 2.0 tokens for the Mercado Libre API. By using this script, you can easily manage the authorization code flow to get the initial access token and use

Downloads

26

Readme

OAuth 2.0 Token Automation with JavaScript

This project provides a JavaScript-based solution to automate the process of obtaining and renewing OAuth 2.0 tokens for the Mercado Libre API. By using this script, you can easily manage the authorization code flow to get the initial access token and use the refresh token to renew the access token when needed.

Features

  • Initial Token Acquisition: Obtain the access token using an authorization code.
  • Token Renewal: Automatically renew the access token using the refresh token.
  • Environment Variable Management: Automatically manage and store tokens in the .env file, making them easily accessible and reusable.

Project Files

  • .env: This file contains the environment variables required by the script. It is automatically updated with new tokens when they are obtained or renewed.
  • .env.template: A template file that outlines the necessary environment variables. Use this as a starting point to create your own .env file.
  • .gitignore: Specifies which files and directories should be ignored in the Git repository, including the .env file to protect sensitive information.
  • index.js: he main script that handles the process of obtaining and renewing OAuth 2.0 tokens.
  • package.json: Contains the project's dependencies and scripts for npm.
  • package-lock.json: Ensures that npm installs the exact versions of dependencies used in the project.
  • test.js: A placeholder file for testing (test specifications to be added).

Requirements

  • Node.js installed on your system.

Installation

  1. Clone this repository to your local machine. bash git clone https://github.com/your-username/oauth-mercadolibre.git
  2. Install the necessary dependencies. bash npm install
  3. Create a .env file based on the provided .env.template and fill in your Mercado Libre credentials.

.env

CLIENT_ID=tu_client_id CLIENT_SECRET=tu_client_secret REDIRECT_URI=tu_redirect_uri AUTHORIZATION_CODE=tu_authorization_code

Usage

To obtain or renew the access token, simply run the main script. Ensure that your .env file is correctly configured before running the script.

bash node index.js

By running this command, the script will either obtain a new access token (if one does not exist) or renew the existing token using the refresh token stored in your .env file. The updated tokens will be saved back to the .env file for future use.