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

@nitromarketingdigital/editor

v1.0.0

Published

SDK para embarcar o Nitro Editor no seu produto: cria o iframe, injeta a sessão e expõe uma API JS por postMessage.

Readme

@nitromarketingdigital/editor

SDK para embarcar o Nitro Editor no seu produto. Ele cria o iframe, injeta a sessão e expõe uma API JS sobre postMessage — o mesmo padrão do Unlayer.

O editor roda isolado num iframe: nada do que você passa entra na página do editor por outro caminho além deste SDK, e nada do que o editor produz sai por outro. A configuração não vai na URL — o documento é grande demais para uma query string e o token não deve ficar no histórico do navegador.

Instalação

npm install @nitromarketingdigital/editor

Ou, sem build, com uma tag <script> (expõe o global NitroEditor):

<script src="https://unpkg.com/@nitromarketingdigital/editor"></script>

Uso

import { init } from '@nitromarketingdigital/editor'

const editor = init({
  container: '#editor',
  url: 'https://editor.nitro.news',
  projectId: 'prj_123',
  contentType: 'webpage',

  // Documento a abrir (opcional — ausente, começa em branco).
  document: undefined,

  // Callbacks do ciclo de vida.
  onReady: () => console.log('editor pronto'),
  onSave: doc => persist(doc),
  onExport: html => publish(html),
  onError: msg => console.error(msg),
})

// A API devolvida conversa com o editor:
editor.save() // pede o documento; a resposta chega em onSave
editor.export() // pede o HTML publicável; chega em onExport
editor.destroy() // tira o editor da página e para de ouvir

Com a tag <script>, é o mesmo código sob o global NitroEditor:

<script>
  NitroEditor.init({ container: '#editor', url: 'https://editor.nitro.news', projectId: 'prj_123', contentType: 'webpage' })
</script>

Arquivos do tenant

O acervo de imagens é seu. Declarando os callbacks abaixo, o browser do usuário fala direto com a sua API — sem a nossa no meio, sem guardarmos credencial de storage alheio. Dois modos, escolhidos pelo que você declara:

  • onSelectImage — você já tem a própria tela de arquivos. O editor pede uma imagem e recebe a escolhida; não desenha biblioteca nenhuma.
  • onListAssets (+ onUploadAsset, onDeleteAsset) — a tela é a do editor, o acervo é seu.
init({
  container: '#editor',
  url: 'https://editor.nitro.news',
  projectId: 'prj_123',
  contentType: 'webpage',
  onSelectImage: async () => ({ url: 'https://cdn.exemplo.com/foto.jpg' }),
})

Nada declarado, o editor usa o próprio storage (se apiBaseUrl e a sessão vierem).

Identidade do usuário

Para o editor saber quem edita, passe user com uma assinatura HMAC-SHA256 do id feita no seu backend com o segredo do projeto — pôr o segredo na página seria entregá-lo a qualquer visitante:

init({
  // …
  user: { id: 'user_42', signature: '<hmac-sha256 do id, no backend>' },
})

API

| Opção | Tipo | | | --- | --- | --- | | container | HTMLElement \| string | Onde o iframe é criado. Obrigatório. | | url | string | URL em que o editor está publicado. Obrigatório. | | projectId | string | Projeto que este editor abre. Obrigatório. É público. | | contentType | 'webpage' | Tipo de conteúdo. Obrigatório. | | document | unknown | Documento a abrir. Ausente, começa em branco. | | apiBaseUrl | string | Origem da API do Nitro Editor. | | user | { id, signature } | Quem está editando (assinatura no backend). | | loader | string \| HTMLElement \| false | Camada sobre o container até o editor subir. false desliga. | | onReady | () => void | O editor subiu e abriu o documento. | | onSave | (document) => void | O documento editado. | | onExport | (html) => void | O HTML publicável. | | onError | (message) => void | Falha. | | onSelectImage / onListAssets / onUploadAsset / onDeleteAsset | callbacks | Arquivos do tenant (ver acima). |

init(options) devolve um EditorHandle com save(), export() e destroy().

Licença

Apache-2.0 © Nitro Marketing Digital