{"id":19702612,"url":"https://github.com/aitthi/nylon","last_synced_at":"2026-03-12T08:36:24.902Z","repository":{"id":122041207,"uuid":"600827707","full_name":"Aitthi/nylon","owner":"Aitthi","description":"Nylon is a web framework for Node.js built with Tokio, Tower, Hyper, and Napi-rs","archived":false,"fork":false,"pushed_at":"2024-06-19T06:39:59.000Z","size":1148,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T03:47:46.025Z","etag":null,"topics":["api","bun","ffi","hyper","napi","napi-rs","node","nodejs","rust","tokio-rs"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aitthi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-12T18:06:20.000Z","updated_at":"2025-02-27T12:38:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bd6dd64-0fde-466d-9377-53fcaa5bb3ef","html_url":"https://github.com/Aitthi/nylon","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Fnylon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Fnylon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Fnylon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Fnylon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aitthi","download_url":"https://codeload.github.com/Aitthi/nylon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251518718,"owners_count":21602200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bun","ffi","hyper","napi","napi-rs","node","nodejs","rust","tokio-rs"],"created_at":"2024-11-11T21:15:38.539Z","updated_at":"2026-03-12T08:36:24.870Z","avatar_url":"https://github.com/Aitthi.png","language":"Rust","readme":"# Nylon Experimental\n\n[![NPM version](https://img.shields.io/npm/v/nylon-rs.svg?style=for-the-badge)](https://www.npmjs.com/package/nylon-rs)\n\nNylon is a web framework for Node.js built with Tokio, Tower, Hyper, and Napi-rs\n\n## Installation\n\n```bash\nnpm install nylon-rs\n```\n\nor\n\n```bash\nyarn add nylon-rs\n```\n\n## Usage\n\n```ts\nimport { Nylon, Logger, Level, Request, Response, HttpException } from 'nylon-rs'\nimport { getHeapStatistics } from 'v8'\nimport os from 'os'\n\nasync function bootstrap() {\n  let logger = new Logger(Level.Info)\n  let app = new Nylon()\n\n  app.get('/', [\n    async (ctx) =\u003e {\n      let req = new Request(ctx)\n      let res = new Response(ctx)\n      res.json({\n        data: {\n          name: 'Nylon',\n          version: '1.0.0',\n          path: req.path(),\n          query: req.queries(),\n          user_agent: req.header('user-agent')\n        }\n      })\n      return res.jump()\n    },\n    async (ctx) =\u003e {\n      // throw new Error(HttpException(401, 'Unauthorized'))\n\n      let res = new Response(ctx)\n      res.status(201)\n      return res.end()\n    }\n  ])\n\n  app.get('/:name', [\n    async (ctx) =\u003e {\n      let req = new Request(ctx)\n      let res = new Response(ctx)\n      res.json({\n        data: {\n          is_params: true,\n          name: 'Nylon',\n          version: '1.0.0',\n          path: req.path(),\n          query: req.queries(),\n          user_agent: req.header('user-agent')\n        }\n      })\n      return res.jump()\n    },\n    async (ctx) =\u003e {\n      // throw new Error(HttpException(401, 'Unauthorized'))\n\n      let res = new Response(ctx)\n      res.status(201)\n      return res.end()\n    }\n  ])\n\n  app.post('/', [\n    async (ctx) =\u003e {\n      let req = new Request(ctx)\n      let res = new Response(ctx)\n      let multipart = await req.multipart({\n        limit: '5mb', // 10mb, 1kb only support kb, mb // 10 * 1024 * 1024\n        allowed_fields: ['name', 'file'] // optional\n      })\n      console.log('multipart', multipart)\n      res.json({\n        data: {\n          method: req.method(),\n          name: 'Nylon',\n          version: '1.0.0',\n          user_agent: req.header('user-agent')\n        }\n      })\n      return res.jump()\n    },\n    async (ctx) =\u003e {\n      // throw new Error(HttpException(401, 'Unauthorized'))\n\n      let res = new Response(ctx)\n      res.status(201)\n      return res.end()\n    }\n  ])\n\n  await app.listen(3000, '0.0.0.0', () =\u003e {\n    let scopeScope = logger.scope('Bootstrap')\n    scopeScope.info(['Worker', process.pid + ' is alive!'].join(' '))\n    scopeScope.info(['HOST_NAME', os.hostname()].join(' '))\n    scopeScope.info(['Platform', os.platform()].join(' '))\n    scopeScope.info(['Node Heap size limit', `${getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`].join(' '))\n    scopeScope.info(`🚀 Application is running on: 0.0.0.0:3000`)\n  })\n}\n\n// Bootstrap for bun 1.0.x\n// @ts-ignore\n// await bootstrap().then(() =\u003e {\n//   console.log('Bootstrap done!')\n// })\n\nbootstrap().then(() =\u003e {\n  console.log('Bootstrap done!')\n})\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitthi%2Fnylon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitthi%2Fnylon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitthi%2Fnylon/lists"}