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 🙏

© 2025 – Pkg Stats / Ryan Hefner

seo-keywords-it

v2.0.0

Published

Libreria JavaScript per estrazione di keyword utili alla SEO da testi in italiano.

Readme

npm version

seo-keywords-it

Estrai facilmente le keyword principali da testi in italiano (e inglese)!
Questa libreria JavaScript aiuta a individuare le parole chiave più rilevanti per SEO, meta tag, content analysis, e tanto altro.


✨ Caratteristiche

  • Estrae automaticamente le keyword principali da testi in italiano e inglese
  • Supporta personalizzazione di stopword e lunghezza minima
  • Estrae anche frasi chiave (bigrammi) oltre alle singole parole
  • Ordina le keyword per frequenza e lunghezza, ottimizzato per SEO
  • Nessuna dipendenza esterna
  • Modulare e facile da integrare

UPDATE MULTI-LINGUA

  • Puoi settare la lingua nella funzione come parametro
  • Supporta attualmente "it" e "en"

⚙️ Requisiti

  • Node.js >= 12

Installazione

npm install seo-keywords-it

Utilizzo Base

const { extractKeywords } = require("seo-keywords-it");

const testo = `
  La libreria seo-keywords-it estrae in modo semplice ed efficace le principali parole chiave dai testi italiani.
  Funziona bene anche per la SEO!
`;

const keywords = extractKeywords(testo);
console.log(keywords);
// Output: [
//   { word: 'libreria', freq: 1 },
//   { word: 'seo', freq: 1 },
//   { word: 'parole chiave', freq: 1 },
//   ...
// ]

Opzioni Avanzate

La funzione extractKeywords può accettare un secondo parametro oggetto per personalizzare il risultato:

const keywords = extractKeywords(testo, {
  maxKeywords: 10, // Numero massimo di keyword restituite (default: 8 o 15 in base al testo)
  minWordLength: 5, // Lunghezza minima delle parole considerate (default: 4)
  extraStopwords: ["modo"], // Stopword aggiuntive da escludere
});

ed un terzo parametro, default di base 'it' se non specificato.

const keywords = extractKeywords(
  testo,
  {
    maxKeywords: 10, // Numero massimo di keyword restituite (default: 8 o 15 in base al testo)
    minWordLength: 5, // Lunghezza minima delle parole considerate (default: 4)
    extraStopwords: ["modo"], // Stopword aggiuntive da escludere
  },
  "en" // cambio lingua stopwords
);

Output

La funzione restituisce un array di oggetti con la parola/frase chiave e la sua frequenza di apparizione:

[
  { word: 'digitali', freq: 3 },
  { word: 'strumenti digitali', freq: 2 },
  { word: 'software su', freq: 2 }
]

Le keyword possono essere sia parole singole che frasi (bigrammi), ordinate per frequenza e lunghezza, per massimizzare la rilevanza SEO.


Come ottenere una stringa per il meta tag keywords

const metaKeywords = keywords.map(k => k.word).join(', ');
// metaKeywords: "digitali, strumenti digitali, software su"

API

extractKeywords(text, options, language)

  • text (string): Il testo da analizzare.
  • options (object, opzionale):
    • maxKeywords (number): Numero massimo di parole chiave da restituire.
    • minWordLength (number): Lunghezza minima delle parole da considerare come keyword.
    • extraStopwords (string[]): Altre parole da escludere oltre a quelle di default.
  • language (string, opzionale): "it" (default) o "en".

Restituisce:
Un array di oggetti { word, freq } con le keyword/frasi più rilevanti trovate.


Esempio Completo

const { extractKeywords } = require("seo-keywords-it");

const testo =
  "Questo è un testo di esempio per estrarre le keyword più importanti e ottimizzare la SEO.";

const keywords = extractKeywords(testo, {
  maxKeywords: 6,
  minWordLength: 5,
  extraStopwords: ["importanti"],
});
// Default lingua Italiano "it"

console.log(keywords);
// Output atteso: [
//   { word: 'esempio', freq: 1 },
//   { word: 'estrarre', freq: 1 },
//   { word: 'keyword', freq: 1 },
//   { word: 'ottimizzare', freq: 1 },
//   { word: 'testo esempio', freq: 1 },
//   { word: 'keyword ottimizzare', freq: 1 }
// ]

Note Tecniche

  • Funziona con Node.js in modalità CommonJS.
  • La lista delle stopword italiane si trova in /src/stopwords-it.js e può essere personalizzata facilmente.
  • La lista delle stopword inglesi si trova in /src/stopwords-en.js e può essere personalizzata facilmente.
  • La funzione è modulare e facilmente integrabile in altri tool di text analysis, scraper o generatori di meta tag.
  • Non fa uso di dipendenze esterne.

Contribuisci

Se vuoi migliorare la libreria, aggiungere nuove funzionalità o estendere la lista delle stopword, apri una issue o una pull request su GitHub!


Licenza

MIT


Autore: Mauro Caputo
GitHub: https://github.com/blackmaurocaputo/seo-keywords-it

Problemi: Apri una segnalazione
GitHub: https://github.com/blackmaurocaputo/seo-keywords-it/issues

Modifiche: Chiedi una modifica
GitHub: https://github.com/blackmaurocaputo/seo-keywords-it/pulls