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

sc-mikrotik

v0.1.0

Published

TypeScript client for the MikroTik RouterOS REST API.

Downloads

23

Readme

sc-mikrotik

Cliente TypeScript para a API REST do MikroTik RouterOS.

Instalação

npm install sc-mikrotik

Uso

import { Mikrotik } from "sc-mikrotik";

const client = new Mikrotik({
  baseUrl: "https://192.168.1.111/rest",
  username: "admin",
  password: "asdf1234",
  insecure: true,
});

const systemResources = await client.SystemResourcePrint();
const systemIdentities = await client.SystemIdentityPrint();
const ipAddresses = await client.IPAddressPrint();
const pppSecrets = await client.PPPSecretPrint();

console.log(systemResources[0]?.platform);
console.log(systemIdentities[0]?.name);
console.log(ipAddresses[0]?.address);
console.log(pppSecrets[0]?.name);

Retorno dos métodos

Os métodos *Print() seguem o comportamento observado no RouterOS REST e retornam arrays:

  • SystemResourcePrint(): Promise<SystemResourcePrintResponse[]>
  • SystemIdentityPrint(): Promise<SystemIdentityPrintResponse[]>
  • IPAddressPrint(): Promise<IPAddressPrintResponse[]>
  • PPPSecretPrint(): Promise<PPPSecretPrintResponse[]>

Mesmo quando o endpoint representa um único item lógico, como system/resource/print e system/identity/print, a API REST do MikroTik retorna uma lista com um item.

Scripts

npm run build
npm test
npm run check:package

Publicação no npm via GitHub Actions

O repositório já fica preparado para publicar no npm pelo workflow em .github/workflows/publish.yml.

Pré-requisitos

  1. Configurar o pacote no npm com Trusted Publishing apontando para o workflow publish.yml deste repositório
  2. Garantir que o nome do pacote em package.json esteja disponível no npm
  3. Atualizar a versão em package.json antes de cada push para deploy

Como publicar

  1. Atualizar a versão em package.json
  2. Commitar e enviar as mudanças para a branch deploy
  3. O GitHub Actions executa npm ci, npm run build e npm publish --provenance usando OIDC, sem NPM_TOKEN
  4. Depois do publish, o workflow cria uma GitHub Release com a tag v
  5. A página da release resume os commits desde a última tag, agrupando feat, fix, refactor, docs, test e chore

Se a tag da versão já existir, o workflow pula o publish e a criação da release para evitar duplicidade no npm.

O erro EOTP acontece quando a publicação usa um token tradicional que ainda exige código 2FA. Com Trusted Publishing, o npm autentica o workflow via OIDC e elimina essa dependência de OTP no CI.

  • api-ssl (porta 8729) → usado por bibliotecas MikroTik
  • www-ssl (porta 443) → usado pelo REST (/rest/...)

Você está usando REST → então o certificado precisa estar no www-ssl, não só no api-ssl.


💡 Se ainda der erro

Tenta forçar TLS 1.2 no curl (Windows às vezes dá bug com TLS):

curl --tlsv1.2 -k -u admin:asdf1234 https://192.168.1.111/rest/system/resource