{"id":28053,"library":"potato-framework","title":"Potato Framework","description":"A simple HTTP framework for Node.js (version 1.2.0). Provides a minimal API for building web servers with routing, request handling, and middleware support. Designed for quick prototyping and small applications. Differentiates by focusing on simplicity and a single main export called Sweet Potato. Active development, but limited documentation and community adoption compared to Express.js. TypeScript types included.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install potato-framework","lang":"bash","label":"npm"},{"cmd":"yarn add potato-framework","lang":"bash","label":"yarn"},{"cmd":"pnpm add potato-framework","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM only since v1.2.0","wrong":"const SweetPotato = require('potato-framework')","symbol":"SweetPotato","correct":"import { SweetPotato } from 'potato-framework'"},{"note":"Default import is the main class; named export is also available.","wrong":"import { default } from 'potato-framework'","symbol":"default","correct":"import Potato from 'potato-framework'"},{"note":"TypeScript type for request objects","wrong":"const { Request } = require('potato-framework')","symbol":"Request","correct":"import { Request } from 'potato-framework'"},{"note":"TypeScript type for response objects","wrong":"import { res } from 'potato-framework'","symbol":"Response","correct":"import { Response } from 'potato-framework'"}],"quickstart":{"code":"import { SweetPotato } from 'potato-framework';\nimport { createServer } from 'http';\n\nconst app = new SweetPotato();\n\napp.get('/', (req, res) => {\n  res.statusCode = 200;\n  res.end('Hello Potato!');\n});\n\nconst server = createServer(app.handle);\n\nserver.listen(3000, () => {\n  console.log('Server running on http://localhost:3000');\n});","lang":"typescript","description":"Basic HTTP server with SweetPotato routing and built-in Node http module."},"warnings":[{"fix":"Use `app.handle.bind(app)` or wrap in arrow function: `(req, res) => app.handle(req, res)`","message":"SweetPotato's handle method must be passed directly, not wrapped in a function, to preserve `this` context.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove any import from 'potato-framework/createServer'","message":"The old `createServer` import path has been removed.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to v18.12.0+ or use a transpiler like Babel.","message":"Node.js version 18.12.0 or higher required due to ESM support.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Manually decode params with `decodeURIComponent()` if needed.","message":"Route parameter extraction is case-sensitive and does not URL-decode automatically.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Bind the handle method: `const server = createServer(app.handle.bind(app));`","cause":"SweetPotato handle is called without proper binding; 'this' is undefined.","error":"TypeError: Cannot read properties of undefined (reading 'path')"},{"fix":"Use `import` statements and ensure `\"type\": \"module\"` in package.json","cause":"Using CommonJS require() instead of ESM import.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Upgrade Node.js to v18.12.0 or later.","cause":"Node.js version below 18.12.0 cannot resolve ESM imports.","error":"ERR_UNSUPPORTED_ESM_URL_SCHEME"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}