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

silabajs

v2.1.0

Published

Spanish syllable splitter — get syllables, accentuation, hiatus, diphthongs and triphthongs from any Spanish word

Readme

SilabaJS

Librería para el análisis silábico de palabras en español. Separa cualquier palabra en sílabas e identifica acentuación, hiatos, diptongos y triptongos.

Zero dependencies · ESM + CJS · Tipado completo en TypeScript

Instalación

npm install silabajs
pnpm add silabajs
yarn add silabajs

Uso rápido

import { getSyllables } from "silabajs";

const resultado = getSyllables("murciélago");
// → { syllables: ['mur', 'cié', 'la', 'go'], accentuation: 'proparoxytone', ... }

Ejemplo completo

import { getSyllables, ACCENT_LABELS, DIPHTHONG_LABELS } from "silabajs";

const r = getSyllables("murciélago");

console.log(r.word); // "murciélago"
console.log(r.syllableCount); // 4
console.log(r.syllables);
// [
//   { syllable: "mur", startIndex: 0 },
//   { syllable: "cié", startIndex: 3 },
//   { syllable: "la",  startIndex: 6 },
//   { syllable: "go",  startIndex: 8 }
// ]

console.log(r.accentuation); // "proparoxytone"
console.log(ACCENT_LABELS[r.accentuation]); // "Esdrújula"

console.log(r.tonicSyllable); // 2  (1-indexed desde la última)
console.log(r.accentedLetterIndex); // 4  (índice de 'é' en la palabra)

console.log(r.diphthongs);
// [{ type: "rising", combination: "ie" }]

console.log(r.hiatus); // []
console.log(r.triphthongs); // []

API

getSyllables(word: string): SyllableResult

Recibe una palabra en español y retorna su análisis silábico completo.

La entrada se normaliza automáticamente a minúsculas y sin espacios laterales.

SyllableResult

| Propiedad | Tipo | Descripción | | --------------------- | ------------------ | -------------------------------------------------------- | | word | string | Palabra normalizada (minúsculas, sin espacios) | | wordLength | number | Cantidad de caracteres | | syllableCount | number | Cantidad de sílabas | | syllables | SyllableInfo[] | Cada sílaba con su índice de inicio en la palabra | | tonicSyllable | number | Posición de la sílaba tónica (1-indexed desde la última) | | accentedLetterIndex | number | Índice de la letra acentuada (-1 si no tiene tilde) | | accentuation | AccentuationType | Tipo de acentuación | | hiatus | HiatusInfo[] | Hiatos detectados | | diphthongs | DiphthongInfo[] | Diptongos detectados | | triphthongs | TriphthongInfo[] | Triptongos detectados |

Tipos de acentuación — AccentuationType

| Valor | Español | Ejemplo | | -------------------- | ------------- | -------------------- | | oxytone | Aguda | café, reloj | | paroxytone | Grave (Llana) | casa, lápiz | | proparoxytone | Esdrújula | murciélago, teléfono | | superproparoxytone | Sobresdrújula | dígamelo |

Tipos de diptongo — DiphthongType

| Valor | Español | Ejemplo | | ------------- | ----------- | ------------------- | | rising | Creciente | ie en cielo | | falling | Decreciente | ai en baile | | homogeneous | Homogéneo | ui en cuidado |

Tipos de hiato — HiatusType

| Valor | Español | Ejemplo | | ----------- | -------- | ---------------------- | | simple | Simple | ae en aeropuerto | | accentual | Acentual | ía en día |

Labels en español

La librería exporta mapas para convertir los valores en inglés a sus nombres en español:

import { ACCENT_LABELS, DIPHTHONG_LABELS, HIATUS_LABELS } from "silabajs";

ACCENT_LABELS.oxytone; // "Aguda"
ACCENT_LABELS.proparoxytone; // "Esdrújula"
DIPHTHONG_LABELS.rising; // "Creciente"
HIATUS_LABELS.accentual; // "Acentual"

Tipos exportados

import type {
  SyllableResult,
  SyllableInfo,
  AccentuationType,
  HiatusInfo,
  HiatusType,
  DiphthongInfo,
  DiphthongType,
  TriphthongInfo,
} from "silabajs";

Licencia

MIT — Nicolás Cofré Méndez