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

elo-api

v0.2.2

Published

Elo CLI utils in node.js and javascript in general

Readme

ES6 Module

Esse pacote também se encontra disponível como um pacote node ES6. Basta só instalá-lo e importá-lo no projeto.

$ yarn add elo-api
$ npm i elo-api
import * as EloApiUtils from 'elo-api';

const generatedBcryptPwd = EloApiUtils.generateBcryptPassword({
    username: 'USERNAME',
    password: 'PASSWORD'
});

Usando localmente

Clone este projeto para um diretório do seu computador e instale as dependências

yarn install

Fluxo de cadastro e login

Em createUser você deve fornecer um bcryptPassword, que é a senha do usuário criptografada usando Bcrypt. Param isso use o comando generate-bcrypt.

Em login você deve fornecer um challenge. Para isso use também o comando generate-bcrypt mas com um parâmetro a mais: --challengeSalt ou -s. Que é o salt que retorna da API da elo createLoginSalt

yarn generate-bcrypt [-- [--username|-u USERNAME] [--password|-p PASSWORD] [--challengeSalt|-s SALT] [--noemit] [-h]]

OBS: Para mais informações utilize a opção -h

Fluxo de criação de cartão Elo

addPublicKeyToUser > createCard

addPublicKeyToProvisionedUser > createProvisionedCard

Em addPublicKeyToUser / addPublicKeyToProvisionedUser você deve fornecer uma chave gerada por você mesmo, que será utilizada posteriormente. Para isso use o comando generate-jwk.

Em createCard / createProvisionedCard você deve fornecer um CardSensitiveInput.json assinado como JWS e depois encriptado como JWE. Para isso use o comando encrypt-card-data.

Configuração

Existem 2 arquivos em config/

  • cardData.json: Dados do cartão a ser encriptado em encrypt-card-data
  • client.json: Dados para fazer request do serverKey. Altere somente o valor de client_id

Eles devem ser configurados antes de prosseguir

CLI API

generate-jwk

yarn generate-jwk [-- [--kid some_string_kid] [--output|-o ~/some/dir/keypair.json] [--copy-to-clipboard] [--noemit] [-h]] 

Gera um par de chaves para ser usado em addPublicKeyToUser ou addPublicKeyToProvisionedUser. O retorno será uma JWK gerada com o algorítmo EC (Elliptic Curve)

encrypt-card-data

yarn encrypt-card-data [-- [--keyPairPath|-kp ~/path/to/keypair.json] [--copy-to-clipboard] [--output|-o ~/some/dir/jwe.json] [--noemit] [-h]]

Encripta os dados de cardData.json para ser usado no campo de sensitive em createCard ou createProvisionedCard.

OBS: Para mais informações utilize a opção -h

Exemplo:

yarn generate-jwk -- -o ./publickey.json --noemit && yarn encrypt-card-data -- --noEmit --output ./jwe.txt --copy-to-clipboard

O snippet acima vai criar um arquivo publickey.json com a public key gerada + um arquivo jwe.txt com a CardSensitiveData encriptada. E ainda irá copiar essa chave para a área de transferência (Clipboard)

JavaScript

Se deseja ver esse exemplo em plain JavaScript (Sem tipagens do TypeScript), utilize yarn build.

Todos os arquivos serão compilados dentro de js/