{"_id":"@laniakeajs/halley.http","_rev":"34-f6a788ab1f7f6058229d39a3aecbb086","name":"@laniakeajs/halley.http","dist-tags":{"development":"2.0.0-development.4","latest":"2.0.0","next":"2.0.0-next.19.5","next-test":"2.0.0-next.14-test.1"},"versions":{"2.0.0-development.2":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-development.2","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_id":"@laniakeajs/halley.http@2.0.0-development.2","_nodeVersion":"18.15.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-KqFnjRNGkMn99/v1/WIseJ/CvN2iS9yGMn5/T2pPKl6g5efVp+VFKabJin5POU0O0rUbDcaibdV2qmrnhwHVdQ==","shasum":"66c940ff8daac04dcc66fea5475656d3c47fabff","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-development.2.tgz","fileCount":21,"unpackedSize":44978,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEDS668togHjZj4hMBDRtYPzHjdfwN2szYGXES3tbug7AiAcle8UKWDn3OcoNJ+GMVFamueLJsSo/T+37rteQIO3lg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSFtbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqO5Q//ZWnPVPZh0fOgJLFzV+TuvciPnh4Kp3Ws8lhI5RCJxaPPLmAs\r\n4VFN3Sjo4agb7doT5ePsmWXVpsUR7M0JIcWF2O+XItP9u6BJFPNfq+l6FWhQ\r\nMr0NNaoeCvlaBmJ9hkGlUx/ZQC0258Di/xKhlMCWgEGSp+2ihS/aXZ3Wz7+b\r\nGr6Sqxur6NPHqj5AUT8BMldDYfS8h956kbBVSFqecV+fFDcT4jQ1amQ5NkGc\r\njjWtni1/esVk+vaBopKSN0JPnnDVhd1PNsvrGEc4xPXO03hm8cPZoYDJ7KFx\r\ntJ1xa60JwudstDiBIderCwWJRY/g4DhJcVosAY9ExPdMlMzlBXTnkvexIfqc\r\nypMSQyIrwjoOQI9ogPHNVeQVsyigGWFAgjYHQVfLitcPD/+PBhOkIyxNYpKm\r\nnxEKiiUZRdxs/7OhL+tJzh4Tk0LDTyR2twaAzcqYFILz9t0JoNCFs9HEsez1\r\nCt2NuH93MCC/1HG42l/Mgz1Ydnnj2cK8tYOl7lMq99U5bJoLihjHvd30Rehw\r\nSx3+wf98+nXdEOrJ5HWJB+gFxvzJx5lmzW/laGCAaB1TWlR5W4v6Hkqrs0yz\r\n2HbfodbJQ0Udf4il5epFIwv/cV078ocyHDFHv4NB03Ygmi+cs2OjJo7w8E0l\r\nBSdxWWFRJAdv3kqJVpUom0OrkeE4Q1ncaUw=\r\n=xOgP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-development.2_1682463579488_0.9542703503576861"},"_hasShrinkwrap":false},"2.0.0-development.3":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-development.3","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"readme":"# Halley.JS ☄️\r\n# The small, fast and easy web framework.\r\n\r\n## The 1.3.0 version of Halley has arrived!!!!\r\n\r\nFast getting started:\r\n\r\n```js\r\n\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  port: 5000,\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(halley.port)\r\n\r\n```\r\n\r\n# Changes of version 1.3.0\r\n\r\n## - Middlewares support!\r\n  - ## But what is a middleware?\r\n    - ### The concept of a middleware was took from express and its basically a function that can take zero or more arguments<br>and return another function that take a request and a response as parameters\r\n    - ### Then when we call the first function, the return value, that is, the function previously mentioned that take a request and a response.<br>Is passed to Halley.js and it will execute it when a request reach to our server\r\n    - ### A middleware allow we to modify the request and the response, for example to modify the headers of the response\r\n\r\n  ### - An little and a bit dirty example of a middleware that allow we to modify the CORS headers:\r\n  ```ts\r\n  // simple-server-middlewares/cors.ts\r\n  import { Request, Reply } from \"halley.http\";\r\n\r\n  interface CorsOptions {\r\n      credentials?: boolean,\r\n      headers?: string[],\r\n      methods?: string | string[],\r\n      origins?: string | string[],\r\n      exposedHeaders?: string[]\r\n      age?: number    \r\n  }\r\n  \r\n  const kDefaultOptions: CorsOptions = {\r\n    methods: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\r\n    origins: \"*\"\r\n  }\r\n  \r\n  export const cors = (options: CorsOptions = kDefaultOptions) => {\r\n    return function(_req: Request, res: Reply) {\r\n      if (options.origins) {\r\n        res.setHeader(\"Access-Control-Allow-Origin\", options.origins)   \r\n      }\r\n    }\r\n  }\r\n  ```\r\n\r\n  ### - Now we'll use this new middleware\r\n  ```ts\r\n  // simple-server-middlewares/index.ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    // Now when we visit the HTML on the browser, we will see the 'Access-Control-Allow-Origin' header on the response section, to see it:\r\n    // Open the developer tools on your favorite browser > go to networking section > click on the '/' file > in the response headers you will see the header\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  })\r\n\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Alternately we can use a middleware individually for one specific route\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware will only be executed on the '/' route. You can check it as the same way that we see the previous example\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - If you want, you can use both methods of use a middleware, for example:\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:10000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware that allow 'Access-Control-Allow-Origin' to http://localhost:3000 will only be executed in the '/' route\r\n  // But 'Access-Control-Allow-Origin' will be allowed for http://localhost:10000 host, however the http://localhost:3000 host is not allowed at '/second'\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Since middlewares have the same struct and functionality that express and other framework based on it you can use some middlewares in halley.js too!\r\n  ### - Keep in mind that some middlewares may not work in halley.js, for example, the cors library from express dont works (almost for now).<br>But the cors from tinyhttp lib do it!\r\n\r\n  ### - As time passes the Halley-Software will publish some middlewares that works fine with Halley.js\r\n#\r\n## By the halley.js unique author for now - Raxabi < openhalleysoftware@gmail.com >","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_id":"@laniakeajs/halley.http@2.0.0-development.3","_nodeVersion":"18.15.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-+HBfgy7T9U/EoCKEaIIYdOPkeaOpYetJ12Sx74MA11/tK46x1TNA8GksQkTm5mycLcUa0sC/qjRdGZqA0Ho9Sw==","shasum":"932edecc508bd38286b12ee773c4ca000ba20b15","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-development.3.tgz","fileCount":19,"unpackedSize":45283,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlbuc98Ret7aumAGBacTIOJE88H64zozi2Lf3k117bcAiAhbyKMMSfJQ7lWeaOThSJ9Wdc/yPwuW0W6BFT1HMfnxg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTxgEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNdg/+KWdRVCyWi3ZRJpNdRbA9ckxqTYDJt4hrkP2Jm4rvNTbU1cho\r\nY7Ssjs9dK7DRW8QKgGhv14hsidrVak82ksv/lwoITF9OPq81rWFjrZi19yTk\r\nWqQ1+heuoJzpO7sD7+OYXxlm12rIBUmvNp1Wc3urkpqs3QrKNn1seCUDt2oa\r\n986zrK75aPeCwFscGPCqq74QysUP2Vxea26hTy0HfiCStAYYWJ9dvt8RpCoB\r\nNSPIskykHjnsZ3mzAiAp3VBg1J/gkk2uu/Hw7195wI2kmwm78tLDvhm4J/21\r\nWfu+RvNrEsRG5IbHHDwR0NVhxtWitICFdanBRF5wgxrGvBUZCDCYMj+7cirs\r\n8ZzVNETdW+ugq+NDBbTO0KytUpmaCv0WkT3KW2UljvT3Jd3rnqRA80q7fRM1\r\nyll340zhsI6XEF5xrchXPelI//2Jz+MG5MPqo+XX3uE2UP/2GyhpKPn/7j7x\r\nDVf8HVeftGtLg2dO4vrIJIBvmnTd2ccFUpQW3bB2T+xJwfSudANEcuNIOIfU\r\nvoofKq+JlTl/r4zUuNXSpSITEOMWcnEEG34WcmZmDyJVNDsqJx1HXmIg8APA\r\nFs8YQP0n9eJornwMpJSE7jCi6UBp5goLvEVU6iW6NgRDFO7r0G46IC/DZZw7\r\nClT9RDIwNn0m4id2HjMzOx6maz0Eeyls8CU=\r\n=RTJP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-development.3_1682905092345_0.6427358698046897"},"_hasShrinkwrap":false},"2.0.0-development.4":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-development.4","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"readme":"# Halley.JS ☄️\r\n# The small, fast and easy web framework.\r\n\r\n## The 1.3.0 version of Halley has arrived!!!!\r\n\r\nFast getting started:\r\n\r\n```js\r\n\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  port: 5000,\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(halley.port)\r\n\r\n```\r\n\r\n# Changes of version 1.3.0\r\n\r\n## - Middlewares support!\r\n  - ## But what is a middleware?\r\n    - ### The concept of a middleware was took from express and its basically a function that can take zero or more arguments<br>and return another function that take a request and a response as parameters\r\n    - ### Then when we call the first function, the return value, that is, the function previously mentioned that take a request and a response.<br>Is passed to Halley.js and it will execute it when a request reach to our server\r\n    - ### A middleware allow we to modify the request and the response, for example to modify the headers of the response\r\n\r\n  ### - An little and a bit dirty example of a middleware that allow we to modify the CORS headers:\r\n  ```ts\r\n  // simple-server-middlewares/cors.ts\r\n  import { Request, Reply } from \"halley.http\";\r\n\r\n  interface CorsOptions {\r\n      credentials?: boolean,\r\n      headers?: string[],\r\n      methods?: string | string[],\r\n      origins?: string | string[],\r\n      exposedHeaders?: string[]\r\n      age?: number    \r\n  }\r\n  \r\n  const kDefaultOptions: CorsOptions = {\r\n    methods: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\r\n    origins: \"*\"\r\n  }\r\n  \r\n  export const cors = (options: CorsOptions = kDefaultOptions) => {\r\n    return function(_req: Request, res: Reply) {\r\n      if (options.origins) {\r\n        res.setHeader(\"Access-Control-Allow-Origin\", options.origins)   \r\n      }\r\n    }\r\n  }\r\n  ```\r\n\r\n  ### - Now we'll use this new middleware\r\n  ```ts\r\n  // simple-server-middlewares/index.ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    // Now when we visit the HTML on the browser, we will see the 'Access-Control-Allow-Origin' header on the response section, to see it:\r\n    // Open the developer tools on your favorite browser > go to networking section > click on the '/' file > in the response headers you will see the header\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  })\r\n\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Alternately we can use a middleware individually for one specific route\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware will only be executed on the '/' route. You can check it as the same way that we see the previous example\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - If you want, you can use both methods of use a middleware, for example:\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:10000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware that allow 'Access-Control-Allow-Origin' to http://localhost:3000 will only be executed in the '/' route\r\n  // But 'Access-Control-Allow-Origin' will be allowed for http://localhost:10000 host, however the http://localhost:3000 host is not allowed at '/second'\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Since middlewares have the same struct and functionality that express and other framework based on it you can use some middlewares in halley.js too!\r\n  ### - Keep in mind that some middlewares may not work in halley.js, for example, the cors library from express dont works (almost for now).<br>But the cors from tinyhttp lib do it!\r\n\r\n  ### - As time passes the Halley-Software will publish some middlewares that works fine with Halley.js\r\n#\r\n## By the halley.js unique author for now - Raxabi < openhalleysoftware@gmail.com >","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_id":"@laniakeajs/halley.http@2.0.0-development.4","_nodeVersion":"18.15.0","_npmVersion":"9.6.5","dist":{"integrity":"sha512-XT8sChZdUO7uZ7z7lFWTjlOyoz60RRFY7KGdH4pOcDcK5VSyfGSpS7noxIfbJJURk6qdlWw5v3bDK+sfNHDMUQ==","shasum":"77adbaba63ee922bf3343e33af131a2aa9f1afd1","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-development.4.tgz","fileCount":19,"unpackedSize":45344,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkOeNEaFZ8237lNg6xxnlAL/37d/bhwdJV7VCq34w40QIhALArjk+taSO7KFbp1FBJFfbP6zmz68QBNBkkeu69aXC5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUC48ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpw1Q/9FqsUxlfnniWS/AFsAPOYLJLc0TNarqlJtN85E5B5uxp5Rtg+\r\nBUXq53KN3erHU12ev+99oyx8F0kVXrYNUoRAwy5jI5dnhRnN4hCzD+3c5Z8Y\r\nYEJwfrEYC/1T5zqB+CWd7atEVHYkZBN9gra6yHpQDSsncaGTHU5mO1+zelrG\r\n7+m0Y0tvt+w0IdMiVaq5chmor80qa9fktvZ8KZXWtYmY86/uLUroZuwZG53j\r\ngAVdQvYafsPdcQuCYEsFdAoLPJnDIDJR01SNOfaUp+N3tLDrh+GERB+CkyBY\r\nmU7ieS79KWCflouXnEMA3eNMmMR75X/2HmdKJBTYMeU1ecxXoP9QihKpnoFe\r\n+4y6DX3b2vz2BEFyjrNErIqKW+xPg+GuNc60Er9vqilb1ZKhZrnGTrGQc55M\r\nd+MjxKx/wdAm6C1+/y6CEFYV9IBqfi9ry3T9YSeLM0byYOxLGhgYtlOy/oog\r\nNV+KMpfGnE3GAbmbj6+ED5v8OtY3KxR2d/Cx+BeywhpJIjI3NHhSxH2OsDzg\r\n0UFtKnoSaOnJvnHvD1APDI8zBtU/w3InjN/56nkpcYBnVwl3/YE2wmzn0/7N\r\n7nP0qCj0/XONp6O1a3X7MMP20OY3WC/o3cP+5HXDlAyEH/R9JctC0Rc+unat\r\nyWgGZsfMUl+RRE1jW4CrbzykRPvYnC2OtLA=\r\n=CXnk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-development.4_1682976315965_0.057188103794785894"},"_hasShrinkwrap":false},"2.0.0-next-development":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next-development","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"readme":"# Halley.JS ☄️\r\n# The small, fast and easy web framework.\r\n\r\n## The 1.3.0 version of Halley has arrived!!!!\r\n\r\nFast getting started:\r\n\r\n```js\r\n\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  port: 5000,\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(halley.port)\r\n\r\n```\r\n\r\n# Changes of version 1.3.0\r\n\r\n## - Middlewares support!\r\n  - ## But what is a middleware?\r\n    - ### The concept of a middleware was took from express and its basically a function that can take zero or more arguments<br>and return another function that take a request and a response as parameters\r\n    - ### Then when we call the first function, the return value, that is, the function previously mentioned that take a request and a response.<br>Is passed to Halley.js and it will execute it when a request reach to our server\r\n    - ### A middleware allow we to modify the request and the response, for example to modify the headers of the response\r\n\r\n  ### - An little and a bit dirty example of a middleware that allow we to modify the CORS headers:\r\n  ```ts\r\n  // simple-server-middlewares/cors.ts\r\n  import { Request, Reply } from \"halley.http\";\r\n\r\n  interface CorsOptions {\r\n      credentials?: boolean,\r\n      headers?: string[],\r\n      methods?: string | string[],\r\n      origins?: string | string[],\r\n      exposedHeaders?: string[]\r\n      age?: number    \r\n  }\r\n  \r\n  const kDefaultOptions: CorsOptions = {\r\n    methods: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\r\n    origins: \"*\"\r\n  }\r\n  \r\n  export const cors = (options: CorsOptions = kDefaultOptions) => {\r\n    return function(_req: Request, res: Reply) {\r\n      if (options.origins) {\r\n        res.setHeader(\"Access-Control-Allow-Origin\", options.origins)   \r\n      }\r\n    }\r\n  }\r\n  ```\r\n\r\n  ### - Now we'll use this new middleware\r\n  ```ts\r\n  // simple-server-middlewares/index.ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    // Now when we visit the HTML on the browser, we will see the 'Access-Control-Allow-Origin' header on the response section, to see it:\r\n    // Open the developer tools on your favorite browser > go to networking section > click on the '/' file > in the response headers you will see the header\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  })\r\n\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Alternately we can use a middleware individually for one specific route\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware will only be executed on the '/' route. You can check it as the same way that we see the previous example\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - If you want, you can use both methods of use a middleware, for example:\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:10000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware that allow 'Access-Control-Allow-Origin' to http://localhost:3000 will only be executed in the '/' route\r\n  // But 'Access-Control-Allow-Origin' will be allowed for http://localhost:10000 host, however the http://localhost:3000 host is not allowed at '/second'\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Since middlewares have the same struct and functionality that express and other framework based on it you can use some middlewares in halley.js too!\r\n  ### - Keep in mind that some middlewares may not work in halley.js, for example, the cors library from express dont works (almost for now).<br>But the cors from tinyhttp lib do it!\r\n\r\n  ### - As time passes the Halley-Software will publish some middlewares that works fine with Halley.js\r\n#\r\n## By the halley.js unique author for now - Raxabi < openhalleysoftware@gmail.com >","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_id":"@laniakeajs/halley.http@2.0.0-next-development","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-aJ5ATEOHTQkEC7rPDwRcCGY9gb4a7XPYOth/3S4PNsRRAaaBS+YyExUyuBh2wZFhiGk7CuPYn91schwKy9MWrA==","shasum":"bd1ce1608c85a003ce93decff42996853f796c31","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next-development.tgz","fileCount":19,"unpackedSize":46451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMh7fyf66DQ+QQyXJHew1D4BiSkSo0TiP3WGiZZZQ11AIhAI1GLGSuxJFs1RY2i4FlOwkqdeuw4rx7eD3jdKgXMb6H"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next-development_1683932895432_0.8274601711005203"},"_hasShrinkwrap":false},"2.0.0-next-development.1":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next-development.1","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","readme":"# Halley.JS ☄️\r\n# The small, fast and easy web framework.\r\n\r\n## The 1.3.0 version of Halley has arrived!!!!\r\n\r\nFast getting started:\r\n\r\n```js\r\n\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  port: 5000,\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(halley.port)\r\n\r\n```\r\n\r\n# Changes of version 1.3.0\r\n\r\n## - Middlewares support!\r\n  - ## But what is a middleware?\r\n    - ### The concept of a middleware was took from express and its basically a function that can take zero or more arguments<br>and return another function that take a request and a response as parameters\r\n    - ### Then when we call the first function, the return value, that is, the function previously mentioned that take a request and a response.<br>Is passed to Halley.js and it will execute it when a request reach to our server\r\n    - ### A middleware allow we to modify the request and the response, for example to modify the headers of the response\r\n\r\n  ### - An little and a bit dirty example of a middleware that allow we to modify the CORS headers:\r\n  ```ts\r\n  // simple-server-middlewares/cors.ts\r\n  import { Request, Reply } from \"halley.http\";\r\n\r\n  interface CorsOptions {\r\n      credentials?: boolean,\r\n      headers?: string[],\r\n      methods?: string | string[],\r\n      origins?: string | string[],\r\n      exposedHeaders?: string[]\r\n      age?: number    \r\n  }\r\n  \r\n  const kDefaultOptions: CorsOptions = {\r\n    methods: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\r\n    origins: \"*\"\r\n  }\r\n  \r\n  export const cors = (options: CorsOptions = kDefaultOptions) => {\r\n    return function(_req: Request, res: Reply) {\r\n      if (options.origins) {\r\n        res.setHeader(\"Access-Control-Allow-Origin\", options.origins)   \r\n      }\r\n    }\r\n  }\r\n  ```\r\n\r\n  ### - Now we'll use this new middleware\r\n  ```ts\r\n  // simple-server-middlewares/index.ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    // Now when we visit the HTML on the browser, we will see the 'Access-Control-Allow-Origin' header on the response section, to see it:\r\n    // Open the developer tools on your favorite browser > go to networking section > click on the '/' file > in the response headers you will see the header\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  })\r\n\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Alternately we can use a middleware individually for one specific route\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware will only be executed on the '/' route. You can check it as the same way that we see the previous example\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - If you want, you can use both methods of use a middleware, for example:\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:10000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware that allow 'Access-Control-Allow-Origin' to http://localhost:3000 will only be executed in the '/' route\r\n  // But 'Access-Control-Allow-Origin' will be allowed for http://localhost:10000 host, however the http://localhost:3000 host is not allowed at '/second'\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Since middlewares have the same struct and functionality that express and other framework based on it you can use some middlewares in halley.js too!\r\n  ### - Keep in mind that some middlewares may not work in halley.js, for example, the cors library from express dont works (almost for now).<br>But the cors from tinyhttp lib do it!\r\n\r\n  ### - As time passes the Halley-Software will publish some middlewares that works fine with Halley.js\r\n#\r\n## By the halley.js unique author for now - Raxabi < openhalleysoftware@gmail.com >","readmeFilename":"README.md","_id":"@laniakeajs/halley.http@2.0.0-next-development.1","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-vvV9fQVnWGJeWfVQUrdMSL2rP/9XCBA5jYTg2Hacdp/UvpsOqCo/ymUxC8jgLaUZNPX87WpKVR7d4sGTQlecbw==","shasum":"6e25928af871f3a234bbc41554036d6f10b9447a","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next-development.1.tgz","fileCount":19,"unpackedSize":46461,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEmg4HnDlxLNRYvq1Jdhwyovje82jy1Ls0gz5Gh5IuP2AiEAvOLpYoO6ecXBMqKn//jZu0eANaWBQx4Wg4+aI4l5TWc="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next-development.1_1683975897691_0.12166497913756036"},"_hasShrinkwrap":false},"2.0.0-next-development.2":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next-development.2","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_id":"@laniakeajs/halley.http@2.0.0-next-development.2","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-uSpL1l1J8DeUl1Vs6JlXX0RIjbE0efKew0IkAJWM+G7EAf38HANIi8fRunITmaeO19sWvS36RO3tOa0JTIrW6w==","shasum":"c505c9a6013ec4f2c0a4cb63fc1ec08fb63f5bdd","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next-development.2.tgz","fileCount":19,"unpackedSize":46438,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtwqpZ+HB181HxXSfhKQ4/PH4y5ZFBP/OLZcm7aqgw5QIhANSLW+GPOqfkmZK+nICBRBZC0YOoqZnh6Gq8pynWywKg"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next-development.2_1683980330183_0.11277808596318217"},"_hasShrinkwrap":false},"2.0.0-next-development.3":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next-development.3","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000","dev":"nodemon test/server/index.ts"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"18.11.18","autocannon":"^7.11.0","eslint":"8.33.0","helmet":"^6.0.1","nodemon":"2.0.20","ts-node":"10.9.1","typescript":"4.9.5"},"readme":"# Halley.JS ☄️\r\n# The small, fast and easy web framework.\r\n\r\n## The 1.3.0 version of Halley has arrived!!!!\r\n\r\nFast getting started:\r\n\r\n```js\r\n\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  port: 5000,\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(halley.port)\r\n\r\n```\r\n\r\n# Changes of version 1.3.0\r\n\r\n## - Middlewares support!\r\n  - ## But what is a middleware?\r\n    - ### The concept of a middleware was took from express and its basically a function that can take zero or more arguments<br>and return another function that take a request and a response as parameters\r\n    - ### Then when we call the first function, the return value, that is, the function previously mentioned that take a request and a response.<br>Is passed to Halley.js and it will execute it when a request reach to our server\r\n    - ### A middleware allow we to modify the request and the response, for example to modify the headers of the response\r\n\r\n  ### - An little and a bit dirty example of a middleware that allow we to modify the CORS headers:\r\n  ```ts\r\n  // simple-server-middlewares/cors.ts\r\n  import { Request, Reply } from \"halley.http\";\r\n\r\n  interface CorsOptions {\r\n      credentials?: boolean,\r\n      headers?: string[],\r\n      methods?: string | string[],\r\n      origins?: string | string[],\r\n      exposedHeaders?: string[]\r\n      age?: number    \r\n  }\r\n  \r\n  const kDefaultOptions: CorsOptions = {\r\n    methods: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\r\n    origins: \"*\"\r\n  }\r\n  \r\n  export const cors = (options: CorsOptions = kDefaultOptions) => {\r\n    return function(_req: Request, res: Reply) {\r\n      if (options.origins) {\r\n        res.setHeader(\"Access-Control-Allow-Origin\", options.origins)   \r\n      }\r\n    }\r\n  }\r\n  ```\r\n\r\n  ### - Now we'll use this new middleware\r\n  ```ts\r\n  // simple-server-middlewares/index.ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    // Now when we visit the HTML on the browser, we will see the 'Access-Control-Allow-Origin' header on the response section, to see it:\r\n    // Open the developer tools on your favorite browser > go to networking section > click on the '/' file > in the response headers you will see the header\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  })\r\n\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Alternately we can use a middleware individually for one specific route\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware will only be executed on the '/' route. You can check it as the same way that we see the previous example\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - If you want, you can use both methods of use a middleware, for example:\r\n  ```ts\r\n  import { Halley } from \"halley.http\"\r\n  import { cors } from \"./cors.ts\"\r\n\r\n  const halley = new Halley({\r\n    port: 5000,\r\n    env: \"development\"\r\n  })\r\n\r\n  halley.register(cors({origins: \"http://localhost:10000\"}))\r\n\r\n  halley.get(\"/\", (req, res) => {\r\n    res.send(\"<h1>Hello, World!</h1>\")\r\n  }, cors({origins: \"http://localhost:3000\"}))\r\n\r\n  halley.get(\"/second\", (req, res) => {\r\n    res.send(\"<h1>This is the secondary route</h1>\")\r\n  })\r\n\r\n  // In this example, the middleware that allow 'Access-Control-Allow-Origin' to http://localhost:3000 will only be executed in the '/' route\r\n  // But 'Access-Control-Allow-Origin' will be allowed for http://localhost:10000 host, however the http://localhost:3000 host is not allowed at '/second'\r\n  halley.ready(5000)\r\n  ```\r\n\r\n  ### - Since middlewares have the same struct and functionality that express and other framework based on it you can use some middlewares in halley.js too!\r\n  ### - Keep in mind that some middlewares may not work in halley.js, for example, the cors library from express dont works (almost for now).<br>But the cors from tinyhttp lib do it!\r\n\r\n  ### - As time passes the Halley-Software will publish some middlewares that works fine with Halley.js\r\n#\r\n## By the halley.js unique author for now - Raxabi < openhalleysoftware@gmail.com >","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_id":"@laniakeajs/halley.http@2.0.0-next-development.3","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-+eITh4VUKO17Y8RzdR3tbCF0DUU8Kfrn55Z3qLe2GR39WuDC0Nx+R8Etj0Cdlaw4qhwW6zziQALgzBlIDGyQ4Q==","shasum":"567e10de931bce595abb41c244a9d474312ee3a3","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next-development.3.tgz","fileCount":19,"unpackedSize":45418,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfDaGbEncKi3FQwOOQAIWsC/t5RhFe6ruHlqiwB4DScAiAhS1jsEXWMcTt42sEXRY85nNxKSkSX54Q5iwJlMyXZxA=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next-development.3_1684163788380_0.26147116884147437"},"_hasShrinkwrap":false},"2.0.0-next":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /acd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters is only in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-rgY4XMKmckaqCjBZkjQxuoowHvCbQFGPc0BJOFLNvJHEahgHUdKpg/1hHrKd/MehMJZj+3s9lj9UzQ7Iq3h/RA==","shasum":"ac536e61e05186e57068bd4bad6419be10c69051","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.tgz","fileCount":19,"unpackedSize":45236,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFppN+N0xdDxX5qJAZQohw4AcJkLmag/eL73LxcPwe5qAiEApWJfOgp4WoeMpuIED5jz1tYiQ27ZIVqsGfeRK9CgAnI="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next_1691596345189_0.5600971183142165"},"_hasShrinkwrap":false},"2.0.0-next.1":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.1","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.1","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /acd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters is only in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-U8rotCAXT0jaL7UkFUxja3i84iHmfDi0nHV/6tVZu/c2Z3KpYpyWxAZO96MLI0DYXKKsYNkV357K/xy0Yf3eGQ==","shasum":"d5f87f3665f3f0ff5b8990ea8e960f55c4e5966b","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.1.tgz","fileCount":19,"unpackedSize":45209,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOfeFRKEl94/IzzXUS1Uk8Qf/xcDsCPzHl6F1xmMRoZAiEA6qANd4BM3X91HONyoaXgH1uVeO2VqeYzyL5B0EYleCk="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.1_1691604691257_0.8939723158736776"},"_hasShrinkwrap":false},"2.0.0-next.2":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.2","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.2","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `any` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /acd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters is only in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-ZEclwBD5fHXmnHhjw0hrGdv5wIwDOmv8HaQi6CNvytkAs2L6ZgP9M6YP7JFKImgHBH6hU+7D9wWYrZI6gjwvCQ==","shasum":"c09ba3d54ee3e3a42f3b74a62fae26b41aa5faea","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.2.tgz","fileCount":19,"unpackedSize":45322,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0Ljd1mkS/B0yqpJ5UsPD+K61d9QIMieKakCesbfapGAiBFRuEf5iPCXcbr9N9hVKAhFBBT5deWlxOstB83RmmrBQ=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.2_1691604973787_0.35666912047563226"},"_hasShrinkwrap":false},"2.0.0-next.3":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.3","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.3","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `any` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters is only in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-Jr5U9nH8dZTjw7+mgnnGZeFgRFS0r/QOpcGR9io0T3IK1FG09tE+ID5+Qi3z9/ilKYIQiyF7uOG9KTdTkFgT2w==","shasum":"02fcf5d5ea9cfa31aa42138b4e952b8db5cf1306","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.3.tgz","fileCount":19,"unpackedSize":45371,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN/dSkW/JEmoK7fX48vDeTLalkBfNeRaiarh+TIGgr1wIhAMEmJwrR/maSm4+FucVT1ngaDHbEBHzLS0C7k274cslJ"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.3_1691605896929_0.876374520677625"},"_hasShrinkwrap":false},"2.0.0-next.4":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.4","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.4","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `string` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters is only in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-ICsZDcv3VTiT802GTwIzmx3FBwZ4p2rv/pLY3XmabLegEnxGfpPc2vhZ+7+wixqAVI95URVRc/dJC+43vfLjGw==","shasum":"e0bb4b9119a70423c3a880998da37a7b7bc608e5","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.4.tgz","fileCount":19,"unpackedSize":45415,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMAotNxEBSTvChKroKhcFBSuO3bUV6uhrjuP5Q+L2hQAiBSho83cUd8HkO4Dk/tX6pZ1HhYCLJeWuyXF5KJ8NPZ9g=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.4_1691638313424_0.12476786023577713"},"_hasShrinkwrap":false},"2.0.0-next.5":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.5","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/express":"^4.17.17","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.5","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `string` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters is only in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-hqRSLT3HNWF9GtJpGoAab02/oG8myLBgzjG1BcOB+X5X9/eZZZxIo7xlo1auY6gkUpLKGUOfBSO5cZyIphOv4w==","shasum":"85e527ee28324a46ce617888f569309647fd4b1e","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.5.tgz","fileCount":19,"unpackedSize":45683,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGaK+ANCL4gNxHT9BMDoSpgJns1Vf7U/fkDg2Jc4J8PQIgGJtJ8hjZ/fcGOD7R1hVNPeB/yNLL4mZcidql+LNir4k="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.5_1691707377947_0.3202262594340073"},"_hasShrinkwrap":false},"2.0.0-next.6":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.6","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/express":"^4.17.17","@types/node":"20.4.8","autocannon":"^7.12.0","eslint":"8.46.0","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.6","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `string` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-QWWg1FYyddxX3JGfZe6e86i6rTpY8UUOKK5zG9QFM4XAGPyM8i2CleLKKTYJNo6KMgZNQt+dH2D8OWV8/K5eCA==","shasum":"7276a2917fde95d923c459df7d7ce492fb0792a3","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.6.tgz","fileCount":19,"unpackedSize":45693,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF8zbhC9ul2ruGWbIlfzVK0QsD7l8XFob0aUbIFAeUeAIgfYJe7jtWDs7wObCTvsCE/I0rlypv67BwMtjixczpBZo="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.6_1691711191980_0.8335301655861294"},"_hasShrinkwrap":false},"2.0.0-next.7":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.7","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/express":"^4.17.17","@types/node":"20.4.9","autocannon":"^7.12.0","eslint":"8.47.0","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.7","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `string` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"../../lib/index.js\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"30b87daa8215ce2f494ba5837e33f989e4f1c8e4","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-yxcZ75xMh3O4JCJMQEbtv4jGnYBdXXLb+SxeVWPC8Ffi8u0geaJ22A8L+raP2Xer6OIRM7eI0IFYeJvxXMqArw==","shasum":"f18d8fd7631f02774a38a98b94b6308e68e4ead3","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.7.tgz","fileCount":19,"unpackedSize":50296,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXKkVweao47GHzwS16tfeKopgSg1QvtUBm1lg/xpr9qAiEAxWBhz8Euh/AQOoy0oIqNDoXlKbEn7/qq0hAvQLaHDFM="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.7_1691784927660_0.39259665850714986"},"_hasShrinkwrap":false},"2.0.0-next.8":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.8","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/express":"^4.17.17","@types/node":"20.4.10","autocannon":"^7.12.0","eslint":"8.47.0","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.8","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `string` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"../../lib/index.js\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"03983801960ec90d5a10e14bbeea1dea395cea55","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-vxcTC+4IEpC+RqdC4mb9UdnVuiSPRDKw/QoFFuwV7sIH3EFh+BOo7GAALd2vr/CgwSePc+pWODBG+JF8y+UseQ==","shasum":"208302a34cbae445a9b592e012c34531abde365a","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.8.tgz","fileCount":19,"unpackedSize":51214,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPUQPtPrjdFViHYp8jujesVVmzdo1ffXhrpFOUKJn2pAIhAIMiasiV8nLGVr/Jg3XxK8pXXpjTsAxMARL+lTudB6it"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.8_1691862459785_0.5335922734180669"},"_hasShrinkwrap":false},"2.0.0-next.9":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.9","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/express":"^4.17.17","@types/node":"20.4.10","autocannon":"^7.12.0","eslint":"8.47.0","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.9","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now `string` type, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-Ql+jMqALgpC3Ut5ANz7ECWvVRfRYsYrU0N9TalphPomBTQ0O5qRWOkz2q27FFgKHZBYIlaQiSEsBT8xJVxyjog==","shasum":"0b8da9eb79b901577adc5d49de296a259d752e40","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.9.tgz","fileCount":19,"unpackedSize":51609,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB1yasALiGPes/AVPKhx+vKB7xWOx4zjcLw6OaQ6lBT5AiB0jxsYhbT533i150V2tiJ8WRWYd6//wodtLWsvnJ4GZg=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.9_1691897943557_0.4648076713635547"},"_hasShrinkwrap":false},"2.0.0-next.10":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.10","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/express":"^4.17.17","@types/node":"20.4.10","autocannon":"^7.12.0","eslint":"8.47.0","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"5.1.6"},"dependencies":{"path-to-regexp":"^6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.10","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-rneL8DZ54Ru2mOdfvmMz24d0otPLUWS6ZAsz15s1twmyxUI7+WRWOCs7+mkfdz9jysaha5QVKFH/AKbtvFdt9g==","shasum":"270e64416494cfecabdaf14af5e01043cf92f9ce","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.10.tgz","fileCount":19,"unpackedSize":51675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiW43B+cXIv0bU4VeSrVGUw6dDZiDllFj2w69QxjDfVAiEAzJl5j67znUTGC0d9snfhU7IN3fYzOxRisICPHVuZjEw="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.10_1692012371249_0.23848539038594851"},"_hasShrinkwrap":false},"2.0.0-next.11":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.11","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.11","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-u++R8NcQ9yaYrVH0/7rPB0BLbfYKwQIgQGZ8hh5TcrnRKkePXlAB0ANWiM1lTpayuY5JYz5M4PUMC7zQRCPJaQ==","shasum":"16577de064b15868a41157439e258f673a5d2b9f","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.11.tgz","fileCount":19,"unpackedSize":59278,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCALZQu8cCTz9xWSYGFzq7a6LSWxw1FyIpdJrZHcE0IvgIhALl6WdfZpsITjI9t95e91KJ94WXXCRstaFO1+FpznwBT"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.11_1692190983158_0.11419382591042648"},"_hasShrinkwrap":false},"2.0.0-next.12":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.12","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.12","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-1MZyyYjCUPVfz96lGwiuQUDk3ZNKi0xqq/eFzPEfh99UZ62vBATAAgUFxk8QIPWs2GYf9+mJIN3yc0QU/GB0bA==","shasum":"996fb849b3fa04462e5a0d17c5a1216b9b6d934f","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.12.tgz","fileCount":19,"unpackedSize":59240,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEeggTGwYHX1zoZ9rP3OUk9DzOspQluiMKsSH0najmwrAiBh54BaEjVdFfenskjR4nACRnYcFmIO22CH5yfzkP8PMA=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.12_1692197919182_0.8130745558142529"},"_hasShrinkwrap":false},"2.0.0-next.13":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.13","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.13","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-4W8hwdSh/Lu1fbNZ89CMsUBgyDAYaT1Vj3vZS5AUheiJ0ueEVSo1TOYKx0ieTiGGbMMHHSC5G5p//RGxg+tCsw==","shasum":"33812819441f0cc8371bc1c9ac7e00e0b5907d68","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.13.tgz","fileCount":19,"unpackedSize":59322,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByRUbkOtevPX9hq/gtKF/HGsLeRai4j54io/u1IAXp0AiB/k2EwFo7zVjK6wscKNEVVAEjVjeB9aeSn33UKP+/d7A=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.13_1692198688208_0.8379848795219798"},"_hasShrinkwrap":false},"2.0.0-next.14-test":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.14-test","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.14-test","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-o2DuNiSaLflePCvUVxnB4wLIvp72/CFmE8H0pTb8DO3kwAa17C0upl8ZZJTWrp4o0tzK5L8++hQPpUi9NNpsrQ==","shasum":"3dd1ad8b99819ba68a5426797ace7913cf3a4efd","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.14-test.tgz","fileCount":3,"unpackedSize":9189,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDjJ8xRGoMtnNyypkHYW7kpvb3jCnv+M4eU106T3dJuAiEAqYvqtluP/PswRh8DvssByP5yqshE/fMDwzlFAnYk5W0="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.14-test_1692198957706_0.11149537870879933"},"_hasShrinkwrap":false},"2.0.0-next.14-test.1":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.14-test.1","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.14-test.1","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-4KPI6TFsvngbqKLWW+GPd+6MNVJpwoImUHr6A8i7PZAjoGVgTyu6L4em7xPtZudgmz5yGqp18IRkXHlTyK4Nkg==","shasum":"fd28dc1e2fbd4ba94e7f5f97018d9e5820bc3d60","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.14-test.1.tgz","fileCount":19,"unpackedSize":59329,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHvQWM0CUa1ZQIF+xvBdS+D2jENfTMJn5AHqH08ucj3gAiAI14nT1VCkoRurDgShlvyZllvLWy1VCUS0aq2qcBaCjA=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.14-test.1_1692199043548_0.7895329314142809"},"_hasShrinkwrap":false},"2.0.0-next.14":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.14","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","types":"./dist/typings/index.d.ts","exports":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.14","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-+iObB0ae4clxarZYx+gs7t/MThEqRMpiJLPaZrikjABk9Wz5igtOQrEoBfWRW69JzLR60xfpCioUYjMVcaLr8A==","shasum":"9fca21a657fc1d478a04654a6897778c25dd7101","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.14.tgz","fileCount":19,"unpackedSize":59322,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOnXvN00CDHFNF8Q/OfUn8jLEL/1dgmk+8RGshs4j8oAIgLZycQSdJdFoVJ+4nVsd3YDUmeV+zxBi79rov4z+tcOo="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.14_1692199346415_0.012066218946439777"},"_hasShrinkwrap":false},"2.0.0-next.15":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.15","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/typings/index.d.ts"}},"scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.15","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"7b17ac0b1c511d7df7cc70d3aeb47c75a238b870","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-bLlcEXBgOWjQtIiwFI63va19LOKttObk0ZtUr+OQB8ZZBPwSv2t9ChknZ7eFlSXYxBpnFL9sHP0VA47GwgB2KA==","shasum":"02637f48165847fbdeec94a4adc52fb7a43e56fa","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.15.tgz","fileCount":19,"unpackedSize":59369,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE8MP3mv6cS4W8W5fcP2E5YWbMwhd2BmEW4OqjkapeTtAiB4Y99ZHnbJ7klvmLyTek5sKy1ViIn8PwQApcWlq78nnQ=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.15_1692207782428_0.715754140190771"},"_hasShrinkwrap":false},"2.0.0-next.16":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.16","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/typings/index.d.ts"}},"scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.16","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"849774b5df509508a524b88432c3379948be3350","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-jLmc11s7pQCR0FGlEYr6GkXVnnCMSIzObwnkubgNbrMl6iVtbERem/rxvV9CnFVq8e9/b+DuojEDutdO6LwWZg==","shasum":"081b28cf1eb94987e6d3c55b186bfe04c182a1fd","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.16.tgz","fileCount":19,"unpackedSize":59801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmDyvB1glMjIixqVbNMBmfiGOVYdXOOKOSm7aAb7MKbAiEAhuLgS5DgeZgKkI4hbef1SRupPOMM+QOH97ahqvotVMs="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.16_1692362055775_0.535957401586159"},"_hasShrinkwrap":false},"2.0.0-next.17":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.17","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/typings/index.d.ts"}},"scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.9.1","@types/cors":"^2.8.13","@types/express":"^4.17.17","@types/multer":"^1.4.7","@types/node":"20.5.0","autocannon":"^7.12.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^3.12.7","typescript":"^5.1.6"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.17","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author for now - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"708f989df99106482397707be7abb8cb6689f019","_nodeVersion":"20.5.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-Kq0MPuRy2ediEdE43t0J3nzJlFpCzAJbRE0chkCj9gca6SCkbdxDHmVvZsf7UBnVxqpQDmXXEA0mhY4ALkr+GQ==","shasum":"7adcaca94e3bf471a3e4b365122cf9e8653b358c","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.17.tgz","fileCount":19,"unpackedSize":60698,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuI1n2W6sAS3dOl9GupKMuDf4vYXmLT0LqBHBBrCiakAiEA2Myc9hKAOyc39Vg2OIpOkbUGldwBxZM0iD+6MawYCLg="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.17_1692598212272_0.18745297198096145"},"_hasShrinkwrap":false},"2.0.0-next.18":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.18","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/typings/index.d.ts"}},"scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\"","test":"tsx --help"},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/multer":"^1.4.11","@types/node":"20.10.1","autocannon":"^7.14.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.1","tsx":"^4.6.1","typescript":"^5.3.2"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.18","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"fd9f9057281838bf39e87a71f5cf01d6cf211e5a","_nodeVersion":"21.2.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-BVKfR4ABNzSh2ilkkVFVRKxN7Vcp4oKKEvAJCkH+U30obADHwaFUqDX3VLKA5/TxSe3YjvaQRbfuAPiiaDTvDw==","shasum":"3e02c5b673c4a53b6e8fd0fe1a101f5029b593cd","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.18.tgz","fileCount":19,"unpackedSize":64372,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBoaIp26NwjgV+iGpGHjMop8zGWmQ/L0AJ9yLq/K1lQjAiEA05huXGZxI5dqA6POBGwQPRxqtw7ZLh9q8TdUhkoQIJY="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.18_1701379776233_0.6664022739202369"},"_hasShrinkwrap":false},"2.0.0-next.19":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.19","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","prepare:types":"Move-Item dist/typings/index.d.ts dist","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/multer":"^1.4.11","@types/node":"^20.10.2","autocannon":"^7.14.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.2","tsx":"^4.6.1","typescript":"^5.3.2"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.19","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"fd9f9057281838bf39e87a71f5cf01d6cf211e5a","_nodeVersion":"21.2.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-eJ2Rhaj0eF8VXy5xbf5CRZzYKId+iy7ntCTNR3OGmNBEY++9Et8+z+WCkrc+WNP140kDYIVImqR5U95eltikjg==","shasum":"32e0bb5bf9e86e8d00196691b95637fce4582c22","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.19.tgz","fileCount":19,"unpackedSize":64655,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZNbD1m0Q6xSsVO4AKScrkBl1WGRZrNvdvmffN9z83qAiEAnkwPt78/CsCKaLriUIAv8mPNo+FR1HDRuy/CFeHQENQ="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.19_1701482141032_0.8436421908158038"},"_hasShrinkwrap":false},"2.0.0-next.19.1":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.19.1","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","prepare:types":"Move-Item dist/typings/index.d.ts dist","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/multer":"^1.4.11","@types/node":"^20.10.2","autocannon":"^7.14.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.2","tsx":"^4.6.1","typescript":"^5.3.2"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.19.1","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"fd9f9057281838bf39e87a71f5cf01d6cf211e5a","_nodeVersion":"21.2.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-OXU1u+VVDn2eR7hq2G0sI0ufCwPqknf2EehHL0GCUHWDW1Ajx/QnWBsxS5ocqsTS35990ir6U6rNjP1VEakYnQ==","shasum":"f8015ba8c461bf1d50e5ee566491da047d4eea5b","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.19.1.tgz","fileCount":19,"unpackedSize":64186,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7IUwMu7j95WqA6QUUQZ4dUf60DpeVD+PGGfoY57jvLAiA49I8b0hvMpO5oBKUtVaKcbX7/Qh2Yy4TbPkoNGVxtug=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.19.1_1701483070434_0.7053538810656106"},"_hasShrinkwrap":false},"2.0.0-next.19.2":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.19.2","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":"./dist/index.js","typings":"./dist/typings/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","prepare:types":"Move-Item dist/typings/index.d.ts dist","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/multer":"^1.4.11","@types/node":"^20.10.2","autocannon":"^7.14.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.2","tsx":"^4.6.1","typescript":"^5.3.2"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.19.2","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"fd9f9057281838bf39e87a71f5cf01d6cf211e5a","_nodeVersion":"21.3.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-ePtNUw2n4hqTibt0sW0z+ZelLx/HIxNg/TL3qDw4plAqOIFFnc5Fxh0Uz7hgsGrjD5nQsV6BaLoucm61Dp+yPQ==","shasum":"6883cf718530984b62b55c663a7fa43f19f4e828","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.19.2.tgz","fileCount":19,"unpackedSize":64632,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm/lcHKjC5XweOwy40+q1pF2BL8gkHjBBEVvwUiSh2LwIhAOkfsucmdJcXDcqKIph0dghIFpaWkKHoj9lur4x7cgNu"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.19.2_1701870296041_0.3548388814754877"},"_hasShrinkwrap":false},"2.0.0-next.19.3":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.19.3","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","exports":{"import":"./dist/index.js","typings":"./dist/typings/index.d.ts"},"scripts":{"build":"tsc -p tsconfig.json","prepare:types":"Move-Item dist/typings/index.d.ts dist","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/multer":"^1.4.11","@types/node":"^20.10.3","autocannon":"^7.14.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.2","tsx":"^4.6.2","typescript":"^5.3.2"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.19.3","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"fd9f9057281838bf39e87a71f5cf01d6cf211e5a","_nodeVersion":"21.3.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-QTTqKtRfOK1GUDcDfEREO1pjx9i/KapQqNc5wI3Ge8iZqemdVZ1akX8dORUTDQtMLvJp8rgCdNyuagF/v1Y+lw==","shasum":"5f6de822f20a239110af4fba149e85009458fae8","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.19.3.tgz","fileCount":19,"unpackedSize":64656,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFPj9U/bVX9m+iFhCTqtqNrxJYRu2fOfCwolJzIM2RrgIgXCe1rYLhdWK1GMGT3Dihfl2O7hadVs6sYL+oPXWMSts="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.19.3_1701870830868_0.4212564430085266"},"_hasShrinkwrap":false},"2.0.0-next.19.4":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.19.4","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","prepare:types":"Move-Item dist/typings/index.d.ts dist","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/multer":"^1.4.11","@types/node":"^20.10.3","autocannon":"^7.14.0","cors":"^2.8.5","express":"^4.18.2","nodemon":"3.0.2","tsx":"^4.6.2","typescript":"^5.3.2"},"dependencies":{"path-to-regexp":"6.2.1"},"_id":"@laniakeajs/halley.http@2.0.0-next.19.4","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"fd9f9057281838bf39e87a71f5cf01d6cf211e5a","_nodeVersion":"21.3.0","_npmVersion":"10.2.1","dist":{"integrity":"sha512-XjkFO1lNwzLkTQLgxaPRdodQTVn+P0E3MUc87GjyPlC+/rGgON0OcpEEmjgpUHmFF9Izzlc38G1GaUHNowBCfw==","shasum":"6d843ff325305e04048bfe53bd6219ceb0d0c179","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.19.4.tgz","fileCount":19,"unpackedSize":64615,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEWnKtXXl2CDRKBU0JGU/HuT7+NsDNpc2kPtMpPlFehVAiAU1DRv1EtA2gOGMWl8GFndYwYyC+D236jY7ZqAAYLXYg=="}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.19.4_1701875631124_0.10901317477573347"},"_hasShrinkwrap":false},"2.0.0-next.19.5":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0-next.19.5","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/node":"^20.12.7","autocannon":"^7.15.0","nodemon":"3.1.0","tsx":"^4.7.2","typescript":"^5.4.5"},"dependencies":{"path-to-regexp":"6.2.2"},"_id":"@laniakeajs/halley.http@2.0.0-next.19.5","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley({\r\n  environment: \"development\"\r\n})\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>This route does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont beings your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md","gitHead":"b936f02e483967dba250f218442a18eb53032699","_nodeVersion":"21.6.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-mp2CK0eRYIp7AUoNkIT7vM28fUxRTNPuaQA8iIJE5KnCiZWpplh3xSHvaj2hWKUIjHzi6OPJIn8wENPVWPQLbg==","shasum":"1a09008e04f2f8c33ec74bbf22030cb505e0d56b","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0-next.19.5.tgz","fileCount":19,"unpackedSize":62700,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0CjCockk58JRitUfBznMljOOgg0mCuAdBxIk036F+cQIhALecYOjncruBLZph+ShhPktgNCNCGNdqmCyPxt2sun+K"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0-next.19.5_1713695601070_0.6417936897800585"},"_hasShrinkwrap":false},"2.0.0":{"name":"@laniakeajs/halley.http","author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"publisher":"Halley Software","version":"2.0.0","contributors":[{"name":"Raxabi"}],"publishConfig":{"access":"public"},"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"homepage":"https://github.com/Halley-Software/halley.js#readme","license":"MIT","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","bench":"autocannon -c 100 -d 40 -p 10 192.168.1.139:5000/","dev":"nodemon -e ts,js --exec tsx \"test/server/index.ts\"","dev:js":"nodemon -e ts,js --exec tsx \"test/server/index.js\""},"engines":{"node":">=15.x"},"devDependencies":{"@tinyhttp/cors":"^2.0.0","@types/autocannon":"^7.12.5","@types/node":"^20.12.7","autocannon":"^7.15.0","nodemon":"3.1.0","tsx":"^4.7.2","typescript":"^5.4.5"},"dependencies":{"path-to-regexp":"6.2.2"},"_id":"@laniakeajs/halley.http@2.0.0","gitHead":"7aa87cc71ee66e88b21abe7645c9a3e79b956d55","_nodeVersion":"21.6.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-cho6dMLhtPceXJcA5BufLKxASaNaE1LaTAy8ZGiNg0XkqsFJXtx7eOHvE0bL8LTNDV5JhMrLZp0aHlBriGO7hg==","shasum":"eb48633563c08d24772f00a64d37d74194778c4a","tarball":"https://registry.npmjs.org/@laniakeajs/halley.http/-/halley.http-2.0.0.tgz","fileCount":19,"unpackedSize":62696,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTI2jsivK5ShjKiPe3JVerxX1F0Y9VFGpbyQ26C9ssMwIhAMVhZQctciroQHgYbQD2gDI+6tVDbL3GLAyO+fPYk4//"}]},"_npmUser":{"name":"raxabiii","email":"openhalleysoftware@gmail.com"},"directories":{},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/halley.http_2.0.0_1713697394417_0.5362890949722305"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-25T22:59:39.406Z","2.0.0-development.2":"2023-04-25T22:59:39.656Z","modified":"2024-04-21T11:03:14.752Z","2.0.0-development.3":"2023-05-01T01:38:12.536Z","2.0.0-development.4":"2023-05-01T21:25:16.176Z","2.0.0-next-development":"2023-05-12T23:08:15.642Z","2.0.0-next-development.1":"2023-05-13T11:04:57.950Z","2.0.0-next-development.2":"2023-05-13T12:18:50.374Z","2.0.0-next-development.3":"2023-05-15T15:16:28.622Z","2.0.0-next":"2023-08-09T15:52:25.422Z","2.0.0-next.1":"2023-08-09T18:11:31.473Z","2.0.0-next.2":"2023-08-09T18:16:13.971Z","2.0.0-next.3":"2023-08-09T18:31:37.109Z","2.0.0-next.4":"2023-08-10T03:31:53.579Z","2.0.0-next.5":"2023-08-10T22:42:58.166Z","2.0.0-next.6":"2023-08-10T23:46:32.156Z","2.0.0-next.7":"2023-08-11T20:15:27.870Z","2.0.0-next.8":"2023-08-12T17:47:40.034Z","2.0.0-next.9":"2023-08-13T03:39:03.754Z","2.0.0-next.10":"2023-08-14T11:26:11.449Z","2.0.0-next.11":"2023-08-16T13:03:03.451Z","2.0.0-next.12":"2023-08-16T14:58:39.386Z","2.0.0-next.13":"2023-08-16T15:11:28.560Z","2.0.0-next.14-test":"2023-08-16T15:15:57.839Z","2.0.0-next.14-test.1":"2023-08-16T15:17:23.727Z","2.0.0-next.14":"2023-08-16T15:22:26.654Z","2.0.0-next.15":"2023-08-16T17:43:02.759Z","2.0.0-next.16":"2023-08-18T12:34:16.039Z","2.0.0-next.17":"2023-08-21T06:10:12.483Z","2.0.0-next.18":"2023-11-30T21:29:36.461Z","2.0.0-next.19":"2023-12-02T01:55:41.213Z","2.0.0-next.19.1":"2023-12-02T02:11:10.591Z","2.0.0-next.19.2":"2023-12-06T13:44:56.283Z","2.0.0-next.19.3":"2023-12-06T13:53:51.040Z","2.0.0-next.19.4":"2023-12-06T15:13:51.375Z","2.0.0-next.19.5":"2024-04-21T10:33:21.336Z","2.0.0":"2024-04-21T11:03:14.594Z"},"maintainers":[{"name":"raxabiii","email":"openhalleysoftware@gmail.com"}],"description":"The small, fast and easy Web Framework part of Laniakea Package Group. Inspired in Express","homepage":"https://github.com/Halley-Software/halley.js#readme","keywords":["framework","web","REST","CRUD","backend","api"],"repository":{"type":"git","url":"git+https://github.com/Halley-Software/halley.js.git"},"contributors":[{"name":"Raxabi"}],"author":{"name":"Raxabi","email":"openhalleysoftware@gmail.com"},"bugs":{"url":"https://github.com/Halley-Software/halley.js/issues"},"license":"MIT","readme":"# Halley.JS ☄️\r\n\r\n## The small, fast and easy web framework\r\n\r\n## The 2.0.0 version of Halley has arrived\r\n\r\nFast getting started:\r\n\r\n```js\r\nimport { Halley } from \"halley.http\"\r\n\r\nconst halley = new Halley()\r\n\r\nhalley.get(\"/\", (req, res) => {\r\n  res.send(\"<h1>Hello World!</h1>\")\r\n})\r\n\r\nhalley.ready(5000)\r\n```\r\n\r\n## Changes of version 2.0.0\r\n\r\n- Now you listen on a port describing the port on `Halley.prototype.ready` function instead of the constructor\r\n\r\n- `Request.prototype.body` property has now type `any`, giving the user more versatility to use this variable\r\n\r\n- You can add some initial routes in the constructor using the `initialRoutes` property\r\n\r\n- Added `Halley.prototype.custom` allowing the user use HTTP methods the he defines\r\n\r\n- Now you can change the response when the requested route would not found in the route stack using `Halley.prototype.setError`\r\n\r\n  - For example:\r\n\r\n    ```ts\r\n    import { Halley } from \"@laniakeajs/halley.http\"\r\n\r\n    const app = new Halley()\r\n\r\n    app.setError = (_, res, notFoundedPath) => {\r\n      res\r\n        .status(404)\r\n        .setHeader(\"Content-Type\", \"text/html\")\r\n        .write(\"<head><style>body {background-color: #242424;color: white}</style></head>\")\r\n      res.send(\"<h2>The route \" + notFoundedPath + \" does not exists!</h2>\")\r\n    }\r\n\r\n    ...\r\n    ```\r\n\r\n- Now the `Route` interface have an optional generic type, to indicate the HTTP Methods that are alloweds\r\n\r\n  - For example, imagine that u want separe the \"GET\" and \"POST\" routes in differents arrays and then add them to Halley.js using `Halley.prototype.use`\r\n\r\n    ```ts\r\n    import { Halley, type Route } from \"@laniakeajs/halley.http\";\r\n\r\n    const app = new Halley()\r\n\r\n    // Indicating the HTTP Method, guarantees that just can use the \"GET\" method\r\n    const getRoutes: Route<\"GET\">[] = [{\r\n      path: \"/\",\r\n      method: \"GET\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello GET!</h1>\")\r\n      }\r\n    }]\r\n\r\n    // The same occurs when using POST\r\n    const postRoutes: Route<\"POST\">[] = [{\r\n      path: \"/\",\r\n      method: \"POST\",\r\n      handler: (_req, res) => {\r\n        res.send(\"<h1>Hello POST!</h1>\")\r\n      }\r\n    }]\r\n\r\n    app.use(getRoutes).use(postRoutes)\r\n\r\n    app.ready(5000)\r\n    ```\r\n\r\n  - If no generic is provided, the default methods passed to the generic are GET, POST, PUST and DELETE\r\n\r\n- URL parameters is now allowed using colons before the parameter name\r\n\r\n  - We are simulating a web store, to use parameters in our path url we can must keep in mind the next:\r\n\r\n    - The url parameters must begins with colon before the parameter name like this: \":parameter\", look the next example:\r\n\r\n    ```ts\r\n    app.get(\"/products/:name\", (req, res) => {\r\n      res.send(\"<h1>The product: \" + req.params.name + \" is available</h1>\")\r\n    })\r\n    ```\r\n\r\n    We are requesting the product on that store that have the same name in the database that the parameter `name`\r\n\r\n- You can use regular expressions instead a string to indicate the route path\r\n\r\n  - Lets try using a regular expresion, in this case using a literal regular expression:\r\n\r\n    ```ts\r\n    app.get(/\\/ab?cd/, (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /abcd or /acd, but not to /bcd or /cd\r\n    ```\r\n\r\n    - Using a constructor:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"/[a-zA-Z0-9]+s$\"), (_req, res) => {\r\n      res.send(\"<h1>Ruta con expresion regular usando un constructor!</h1>\")\r\n    })\r\n\r\n    // With this regex, you can access to /products, /elements, /users\r\n    // Or any other route that includes letter from a to z without case sensitive o any number in any position\r\n    // As long as the route ends with 's', but it can not contains only 's' for example: /s\r\n    ```\r\n\r\n    - Of course, if you dont starts your route paths with a '/' it will throw an error too, an example would be this:\r\n\r\n    ```ts\r\n    // Here we are using a literal regex, in this case, you need to escape the slash character (/), like in this example\r\n    app.get(/\\/route1/, ...)\r\n    ```\r\n\r\n    - In another way if you doesnt escape the character JavaScript / TypeScript will conside the line a comment:\r\n\r\n    ```ts\r\n    app.get(//route1/, ...)\r\n    ```\r\n\r\n    - Or if you try to not escape the character and just write the literal regex, will throw an error, like this:\r\n\r\n    ```ts\r\n    app.get(/route1/, ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n    In this case Halley.js throws an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n\r\n    - Would happen the same if you use the `RegExp` constructor using the new operator:\r\n\r\n    ```ts\r\n    app.get(new RegExp(\"route1\"), ...)\r\n\r\n    // Cause an HALLEY_ROUTE_DO_NOT_START_WITH_SLASH exception\r\n    ```\r\n\r\n## Internal details\r\n\r\n- Regexs path are checked using the `RegExp.prototype.source` property, it returns a string containing the regex content:\r\n\r\n  1. In the case of a literal regex the value between both slashes are returned\r\n\r\n  2. In the case of a regex created using his constructor;\r\n\r\n      1. If a literal regex is passed, cause the `1.` step behavior\r\n\r\n      2. If a string is passed, returns that string but scaping some characters like slashes\r\n\r\n          - like in this example:\r\n\r\n          ```ts\r\n          new RegExp(\"/route1\").source // Output -> \\/route1 <- The escape character is added automatically to escape the slash\r\n          ```\r\n\r\n  - In this way Halley.js forces you to add a slash at the route path begins, checking the [1] string position that returns `RegExp.prototype.source`\r\n\r\n- `Halley` class now inherit from the `HRouter` class\r\n\r\n- Now path parameters validation occurs in the HRouter path using `path-to-regexp` package, its useful, zero dependencies and easy to use\r\n\r\n- The Request and Reply / Response objects are now passed as parameters instead of being a class property\r\n\r\n- Middlewares are now resolved using Promise class methods like `Promise.resolve` or `Promise.all`\r\n\r\n- The global middleware array changed his name to `middlewareStack`, now is called similar to the route array\r\n\r\n## Fixes\r\n\r\n- Fix bug that doesnt allow use global middlewares and local middleware simultaneously (in method `makeSuitable` validation)\r\n\r\n## By the halley.js unique author / contributor at the moment - Raxabi <openhalleysoftware@gmail.com>\r\n","readmeFilename":"README.md"}