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

@enfermeria/sdk

v0.1.0

Published

Official JavaScript/TypeScript SDK for the EnfermerIA Public API.

Readme

EnfermerIA JavaScript SDK

SDK oficial JavaScript/TypeScript para consumir la API publica de EnfermerIA sin tener que montar manualmente el flujo de subida, creacion de jobs y polling.

Requisitos

  • Node.js 18+
  • fetch nativo disponible en runtime

Instalacion

Desde npm cuando se publique

npm install @enfermeria/sdk

Instalacion local desde ruta del disco

Desde otro proyecto consumidor:

npm install C:\ruta\al\repo\sdk\javascript

O con una ruta relativa:

npm install ../EnfermerIA/sdk/javascript

Desarrollo con npm link

En la carpeta del SDK:

cd sdk/javascript
npm install
npm run build
npm link

En el proyecto consumidor:

npm link @enfermeria/sdk

Configuracion

import { EnfermerIAClient } from "@enfermeria/sdk";

const client = new EnfermerIAClient({
  apiKey: process.env.ENFERMERIA_API_KEY!,
  baseUrl: "https://enfermer-ia.com/api",
  timeoutMs: 30_000
});

baseUrl acepta tanto la raiz del sitio (https://enfermer-ia.com) como la raiz de la API (https://enfermer-ia.com/api). Para local puedes usar http://localhost:3000 o http://localhost:3000/api.

Ejemplos de uso recomendados

A) Ruta local de archivo en Node

const result = await client.analyzeImageAndWait({
  file: "./talon.png",
  clinicalContext: "Paciente con ulcera en talon"
});

B) Buffer

import { readFileSync } from "node:fs";

const result = await client.analyzeImageAndWait({
  file: readFileSync("./talon.png"),
  filename: "talon.png"
});

C) Uso explicito completo

import { readFileSync } from "node:fs";

const result = await client.analyzeImageAndWait({
  file: readFileSync("./talon.png"),
  filename: "talon.png",
  contentType: "image/png",
  clinicalContext: "Paciente con ulcera en talon"
});

Reglas de inferencia

filename

El SDK intenta inferir filename en este orden:

  1. options.filename si viene explícito.
  2. El nombre de la ruta local si file es un string en Node.
  3. File.name si file es File.
  4. Un fallback basado en el MIME, por ejemplo upload.png.
  5. Si no hay pistas, upload.bin.

contentType

El SDK intenta inferir contentType en este orden:

  1. options.contentType si viene explícito.
  2. La extensión de filename.
  3. La extensión de la ruta local si file es un string.
  4. File.type o Blob.type si existen.
  5. Fallback interno application/octet-stream.

Extensiones soportadas por inferencia:

  • png -> image/png
  • jpg/jpeg -> image/jpeg
  • webp -> image/webp
  • gif -> image/gif
  • bmp -> image/bmp
  • tif/tiff -> image/tiff

Si después de inferir el resultado sigue siendo demasiado ambiguo para la API pública actual, el SDK lanza un error claro pidiendo filename o contentType explícitos.

Metodos principales

  • getUploadUrl()
  • uploadFileToSignedUrl()
  • createAnalysisJob()
  • getJob()
  • waitForJob()
  • analyzeImage()
  • analyzeImageAndWait()

Exports principales

El entrypoint principal exporta:

  • EnfermerIAClient
  • Tipos principales (AnalyzeFileInput, AnalyzeImageOptions, AnalysisResult, WaitForJobOptions, etc.)
  • Errores principales (EnfermerIAError, EnfermerIAApiError, EnfermerIAUploadError, EnfermerIAJobError, EnfermerIATimeoutError)

Import soportado:

import { EnfermerIAClient } from "@enfermeria/sdk";

Manejo de errores

import {
  EnfermerIAApiError,
  EnfermerIAJobError
} from "@enfermeria/sdk";

try {
  const result = await client.analyzeImageAndWait({
    file: "./talon.png"
  });

  console.log(result);
} catch (error) {
  if (error instanceof EnfermerIAApiError) {
    console.error(error.statusCode, error.endpoint, error.apiMessage);
  }

  if (error instanceof EnfermerIAJobError) {
    console.error(error.jobId, error.apiMessage);
  }
}

Como probarlo contra produccion

const client = new EnfermerIAClient({
  apiKey: process.env.ENFERMERIA_API_KEY!,
  baseUrl: "https://enfermer-ia.com"
});

Como probarlo contra localhost

const client = new EnfermerIAClient({
  apiKey: process.env.ENFERMERIA_API_KEY!,
  baseUrl: "http://localhost:3000"
});

Ejemplos incluidos

  • examples/node-basic.ts
  • examples/analyze-and-wait.ts
  • examples/from-path.ts
  • examples/from-buffer.ts

Desarrollo del paquete

cd sdk/javascript
npm install
npm run test
npm run build

Probar empaquetado local

npm run pack:dry
npm run pack