{"_id":"@codelyr/pixelrest","name":"@codelyr/pixelrest","dist-tags":{"latest":"2.0.8"},"versions":{"2.0.8":{"name":"@codelyr/pixelrest","version":"2.0.8","type":"module","description":"API REST node.js","private":false,"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","start":"tsx ./example/main.ts","dev":"tsx watch ./example/main.ts","prepare-file":"tsx ./example/app/scripts/prepareDatabase.ts","test":"vitest run","test:watch":"vitest","lint":"eslint .","docker:build":"docker compose -f example/docker-compose.yml up --build","test:functional":"docker compose -f example/docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from test --no-attach mysql --no-attach postgres --no-attach app-mysql --no-attach app-postgres","docs:dev":"cd docs && npm run dev","docs:docker":"docker compose -f docs/docker-compose.yml up --build","mcp:install":"cd mcp && npm install","mcp:start":"tsx mcp/server.ts"},"bin":{"pixelrest-new":"bin/generate-project.js"},"dependencies":{"bcrypt":"^6.0.0","express":"^5.2.1","express-rate-limit":"^8.2.1","helmet":"^8.1.0","jose":"^6.1.3","loglevel":"^1.9.1","multer":"^2.0.2","mysql2":"^3.9.1","pg-promise":"^12.6.1","swagger-ui-express":"^5.0.1","zod":"^3.24.2"},"devDependencies":{"@eslint/js":"^10.0.1","@types/bcrypt":"^6.0.0","@types/express":"^5.0.6","@types/morgan":"^1.9.10","@types/multer":"^2.0.0","@types/node":"^25.2.3","@types/swagger-ui-express":"^4.1.8","@typescript-eslint/eslint-plugin":"^8.56.0","@typescript-eslint/parser":"^8.56.0","eslint":"^10.0.0","globals":"^17.3.0","morgan":"^1.10.1","tsx":"^4.21.0","typescript":"^5.9.3","vitest":"^4.0.18"},"exports":{"./service":{"types":"./dist/nodeExpress/Service/Service.d.ts","default":"./dist/nodeExpress/Service/Service.js"},"./middleware":{"types":"./dist/nodeExpress/Middleware/Middleware.d.ts","default":"./dist/nodeExpress/Middleware/Middleware.js"},"./server":{"types":"./dist/nodeExpress/Server/Server.d.ts","default":"./dist/nodeExpress/Server/Server.js"},"./controller":{"types":"./dist/nodeExpress/Controller/Controller.d.ts","default":"./dist/nodeExpress/Controller/Controller.js"},"./logger":{"types":"./dist/loggers/Logger/Logger.d.ts","default":"./dist/loggers/Logger/Logger.js"},"./httpResolver":{"types":"./dist/loggers/HttpResolver/HttpResolver.d.ts","default":"./dist/loggers/HttpResolver/HttpResolver.js"},"./clone":{"types":"./dist/general/Clone/Clone.d.ts","default":"./dist/general/Clone/Clone.js"},"./collection":{"types":"./dist/general/Collection/Collection.d.ts","default":"./dist/general/Collection/Collection.js"},"./snakeToCamelParser":{"types":"./dist/general/SnakeToCamelParser/SnakeToCamelParser.d.ts","default":"./dist/general/SnakeToCamelParser/SnakeToCamelParser.js"},"./repository":{"types":"./dist/database/Repository/Repository.d.ts","default":"./dist/database/Repository/Repository.js"},"./bddParser":{"types":"./dist/database/BddParser/BddParser.d.ts","default":"./dist/database/BddParser/BddParser.js"},"./mysqlParser":{"types":"./dist/database/MysqlParser/MysqlParser.d.ts","default":"./dist/database/MysqlParser/MysqlParser.js"},"./postgresParser":{"types":"./dist/database/PostgresParser/PostgresParser.d.ts","default":"./dist/database/PostgresParser/PostgresParser.js"},"./auth":{"types":"./dist/authentication/Auth/Auth.d.ts","default":"./dist/authentication/Auth/Auth.js"},"./password":{"types":"./dist/authentication/Password/Password.d.ts","default":"./dist/authentication/Password/Password.js"},"./types":{"types":"./dist/types.d.ts","default":"./dist/types.js"},"./httpMethods":{"types":"./dist/nodeExpress/http-methods.config.d.ts","default":"./dist/nodeExpress/http-methods.config.js"},"./dbConnection":{"types":"./dist/database/Repository/repository.config.d.ts","default":"./dist/database/Repository/repository.config.js"},"./express":{"types":"./dist/nodeExpress/express.d.ts","default":"./dist/nodeExpress/express.js"}},"repository":{"type":"git","url":"git+https://github.com/codelyr/pixelrest.git"},"author":{"name":"pixeltraits"},"license":"MIT","bugs":{"url":"https://github.com/codelyr/pixelrest/issues"},"homepage":"https://github.com/codelyr/pixelrest#readme","keywords":["pixelrest","node-rest","api-rest"],"gitHead":"27ce383191a2f7d7c6980dba33d13327d82317a8","_id":"@codelyr/pixelrest@2.0.8","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-bebC2Q56tTBoaG7Y/OW7tD3hRbj5jYP7FbekSeMQTjH2Ovka+9O1Vck+5q1Q4OWcokV94YbXeFtIS963/sYmkg==","shasum":"f55dd642ee1fda29d0dc77139521955ab559f507","tarball":"https://registry.npmjs.org/@codelyr/pixelrest/-/pixelrest-2.0.8.tgz","fileCount":274,"unpackedSize":231954,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC6PM3MBsN2sSOa2btjhbWIbsez0C2G+1Sc6y80+r1DmQIhAL2JY+ipvcwlEJZmGAJ+uqWu4IkFfgLQvG0mowS2/tLO"}]},"_npmUser":{"name":"codelyr","email":"erwan.moreau@codelyr.fr"},"directories":{},"maintainers":[{"name":"codelyr","email":"erwan.moreau@codelyr.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pixelrest_2.0.8_1779485767443_0.5469446242460927"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T21:36:06.987Z","2.0.8":"2026-05-22T21:36:07.586Z","modified":"2026-05-22T21:36:07.784Z"},"maintainers":[{"name":"codelyr","email":"erwan.moreau@codelyr.fr"}],"description":"API REST node.js","homepage":"https://github.com/codelyr/pixelrest#readme","keywords":["pixelrest","node-rest","api-rest"],"repository":{"type":"git","url":"git+https://github.com/codelyr/pixelrest.git"},"author":{"name":"pixeltraits"},"bugs":{"url":"https://github.com/codelyr/pixelrest/issues"},"license":"MIT","readme":"# Pixelrest\nMake API REST on node.js\n\n## Get started\n\nInstall pixelrest with npm:\n```\nnpm install --save pixelrest\n```\n\nGenerate a project pixelrest:\n```\npixelrest-new\n```\n\nSet your node project in ES module mode, add the following property to your package.json file:\n```json\n\"type\": \"module\"\n```\n\n### Database\n\nPixelrest supports **MySQL/MariaDB** and **PostgreSQL**.\n\n#### MySQL / MariaDB\nCreate a MySQL/MariaDB database (InnoDB).\n\n#### PostgreSQL\nCreate a PostgreSQL database.\n\n### Configuration\n\nCreate file `secret.js` in `app/config` with your database credentials and JWT secret.\n\nMySQL example:\n```js\nexport const DB_CREDENTIALS = {\n  DATABASE: 'mydatabase',\n  HOST: 'localhost',\n  PORT: 3306,\n  USERNAME: 'root',\n  PASSWORD: 'password'\n};\n\nexport const JWT = {\n  SECRET: 'mysecret',\n  EXPIRES_IN: 14400\n};\n```\n\nPostgreSQL example:\n```js\nexport const DB_CREDENTIALS = {\n  DATABASE: 'mydatabase',\n  HOST: 'localhost',\n  PORT: 5432,\n  USERNAME: 'postgres',\n  PASSWORD: 'password'\n};\n\nexport const JWT = {\n  SECRET: 'mysecret',\n  EXPIRES_IN: 14400\n};\n```\n\n### Prepare and run\n\nPrepare your database with the script:\n```\nnode ./app/scripts/prepareDatabase.js\n```\n\nStart your server:\n```\nnpm start\n```\n\nTest your API REST with swagger:\n```\nhttp://localhost:1338/api-docs\n```\n\nBefore testing the documents service, don't forget to create the `documents` directory in your project.\n\n## Scripts\n\n| Command | Description |\n|---------|-------------|\n| `npm start` | Start the server with nodemon |\n| `npm test` | Run tests with Vitest |\n| `npm run test:watch` | Run tests in watch mode |\n| `npm run lint` | Run ESLint |\n| `npm run prepare-file` | Prepare database tables |\n\n## CLI\n\nThe `pixelrest-new` command generates a ready-to-use project structure with example services, repositories, and configuration files.\n\n```\nnpx pixelrest-new\n```\n\n## Security\nNever push `secret.js` on your git. You should add it to your `.gitignore`!\n","readmeFilename":"README.md","_rev":"1-a6a5a3a7b97c8ee6239093e1f8a13e64"}