Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

package.json Generator — Create a Node.js package.json

Fill in a form and get a valid package.json — npm name validation, script presets for Vite, Next.js, Node and TypeScript libraries, exports, engines, license and repository — with warnings for common mistakes.

Atualizado em
package.json

    Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

    Como usar: package.json Generator

    1. Enter the package name and version — the name is checked against npm’s naming rules as you type.
    2. Choose a scripts preset (Node, Vite, Next.js, TypeScript library) and the module type.
    3. Add license, author, repository and the Node.js version your code needs.
    4. Copy or download the file into your project root, then run npm install to add dependencies.

    The most important package.json fields

    FieldWhat it does
    namePackage name — lowercase, max. 214 characters, URL-safe, may be scoped (@org/name)
    versionA semantic version like 1.4.2
    type"module" treats .js files as ES modules (import); default is CommonJS
    main / exportsThe entry point(s) other code imports. exports also hides internal files
    scriptsCommands for npm run dev, build, test…
    enginesNode.js versions your code supports
    privatetrue prevents accidental npm publish
    packageManagerPins npm, pnpm or Yarn via Corepack

    Dependencies are added by the package manager

    Don’t type dependency versions by hand — run npm install react or npm install -D vite and npm writes them with the right version range (usually ^). Commit the lock file so everyone installs the same versions.

    Next steps for a new project

    Add a .gitignore (at least node_modules/ and .env), an .editorconfig, a README and a GitHub Actions workflow that runs your test and build scripts on every push.

    Também pesquisado como: package.json example, npm init, package.json scripts, package.json exports, node package.json, npm package name rules, package.json type module.

    Ferramentas que combinam com: package.json Generator

    • Formatação JSON — Cole o JSON aqui para formatá-lo, compactá-lo ou validá-lo.
    • YAML Validator — Paste a Docker Compose file, Kubernetes manifest, GitHub Actions workflow or any YAML to pinpoint errors, catch common pitfalls and get a cleanly formatted version.
    • Kubernetes YAML Generator — Fill in your app’s name, image and port and get production-ready Kubernetes YAML: a Deployment with probes, resource limits and a hardened security context, plus the Service, Ingress with TLS, ConfigMap, Secret and HorizontalPodAutoscaler you tick — in one file ready for kubectl apply.
    • systemd Service Generator — Run your app as a proper Linux service that starts on boot and restarts when it crashes.

    Perguntas frequentes

    What are the rules for npm package names?
    Lowercase only, no spaces, max. 214 characters, can’t start with a dot or underscore, only URL-safe characters (letters, digits, - . _ ~), and not a Node.js core module name like http. Scoped names look like @scope/name.
    Should I use "type": "module"?
    For new projects, yes — ES modules are the standard and work in Node.js 18+, Vite and most tools. Use CommonJS only if you depend on tooling that requires require().
    What does "private": true do?
    It makes npm refuse to publish the package, which protects apps and internal projects from being published by accident.
    Where do dependencies go?
    Install them with npm, pnpm or Yarn; the tool writes them into dependencies or devDependencies automatically.
    Posso instalar o package.json Generator como um aplicativo da web e usá-lo offline?
    Sim. O package.json Generator é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

    Ferramentas relacionadas