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

tkmilhas-sdk

v1.0.7

Published

SDK for TKMilhas API

Readme

TKMilhas SDK

SDK em TypeScript para a API do TKMilhas, com suporte para CommonJS e ESM.

O que é o TKMilhas?

O TKMilhas é uma plataforma especializada em pesquisa e comparação de passagens aéreas utilizando milhas ou pontos de programas de fidelidade. A plataforma permite encontrar as melhores ofertas de voos usando pontos de diferentes programas como LATAM, GOL, Azul, Smiles, entre outros.

Este SDK facilita a integração com a API do TKMilhas, permitindo realizar buscas de voos, consultar aeroportos disponíveis e autenticar usuários de forma simples e direta.

Instalação

npm install tkmilhas-sdk

Uso

ESM

import TKMilhasClient from 'tkmilhas-sdk';

const client = new TKMilhasClient();

CommonJS

const { TKMilhasClient } = require('tkmilhas-sdk');

const client = new TKMilhasClient();

Autenticação

const response = await client.login({
  username: 'seu-usuario',
  password: 'sua-senha',
});

console.log('Token:', response.token);

Exemplo de Resposta da Autenticação

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InNldS11c3VhcmlvIiwiaWF0IjoxNjI1NjcyMzQ1LCJleHAiOjE2MjU3NTg3NDV9.exampleTokenSignature123456789"
}

Busca de Voos

const searchResults = await client.search({
  cia: 'GOL',
  flight: {
    origin: 'GRU',
    destination: 'JFK',
    departureDate: '20-11-2025',
    cabin: 'ECONOMY',
    returnDate: '24-11-2025'
  },
  passengers: {
    adults: 1,
    child: 0,
    babies: 0
  },
  options: {
    isTwoWays: true,
    skipCache: false,
    companyReturn: false,
    salePrice: true
  }
});

console.log('Resultados da busca:', searchResults);

Exemplo de Resposta da Busca

{
  "statusCode": 200,
  "warnings": null,
  "success": true,
  "combine": true,
  "duration": 1.935,
  "fromAirport": "GRU",
  "toAirport": "JFK",
  "departureDate": "2025-11-20",
  "returnDate": "2025-11-24",
  "adult": 1,
  "child": 0,
  "cabin": "ECONOMY",
  "program": "GOL",
  "flights": {
    "outbound": [
      {
        "id": "flight-123",
        "recommendation": ["return-456", "return-789"],
        "segments": [
          {
            "from": "GRU",
            "to": "JFK",
            "departure": "2025-11-20T08:30:00",
            "arrival": "2025-11-20T16:45:00",
            "flightNumber": "G31234",
            "aircraft": "Boeing 777",
            "duration": "08:15"
          }
        ],
        "stops": 0,
        "duration": "08:15",
        "cabin": "ECONOMY",
        "offers": [
          {
            "miles": 35000,
            "money": 250.50,
            "moneyPrice": 2800.00
          }
        ]
      }
    ],
    "inbound": [
      {
        "id": "return-456",
        "recommendation": "flight-123",
        "segments": [
          {
            "from": "JFK",
            "to": "GRU",
            "departure": "2025-11-24T19:20:00",
            "arrival": "2025-11-25T07:45:00",
            "flightNumber": "G35678",
            "aircraft": "Boeing 777",
            "duration": "09:25"
          }
        ],
        "stops": 0,
        "duration": "09:25",
        "cabin": "ECONOMY",
        "offers": [
          {
            "miles": 40000,
            "money": 280.75,
            "moneyPrice": 3100.00
          }
        ]
      }
    ]
  }
}

Obter Aeroportos

const airports = await client.getAirports();
console.log('Aeroportos:', airports);

Exemplo de Resposta de Aeroportos

[
  {
    "code": "GRU",
    "name": "Aeroporto Internacional de São Paulo-Guarulhos",
    "city": "São Paulo",
    "country": "Brasil"
  },
  {
    "code": "CGH",
    "name": "Aeroporto de Congonhas",
    "city": "São Paulo",
    "country": "Brasil"
  },
  {
    "code": "BSB",
    "name": "Aeroporto Internacional de Brasília",
    "city": "Brasília",
    "country": "Brasil"
  },
  {
    "code": "JFK",
    "name": "Aeroporto Internacional John F. Kennedy",
    "city": "Nova York",
    "country": "Estados Unidos"
  }
]

Programas Suportados

O TKMilhas suporta busca em diversos programas de fidelidade, incluindo:

  • LATAM Pass
  • Smiles (GOL)
  • TudoAzul
  • TAP Miles&Go
  • E outros programas parceiros

Observações Importantes

  • Todas as buscas requerem autenticação prévia
  • Os resultados podem variar de acordo com a disponibilidade e as regras de cada programa
  • O parâmetro combine na resposta indica se os voos de ida e volta podem ser combinados livremente ou se há restrições