{"id":13605254,"url":"https://github.com/georgesmith46/bcbp","last_synced_at":"2025-04-12T05:32:15.519Z","repository":{"id":32630623,"uuid":"138376650","full_name":"georgesmith46/bcbp","owner":"georgesmith46","description":"Encoding/decoding library for the IATA Bar Coded Boarding Pass","archived":false,"fork":false,"pushed_at":"2024-04-23T05:06:16.000Z","size":5343,"stargazers_count":53,"open_issues_count":7,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-23T09:35:53.489Z","etag":null,"topics":["barcode","boardingpass","iata"],"latest_commit_sha":null,"homepage":"https://npm.im/bcbp","language":"JavaScript","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/georgesmith46.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-23T06:18:56.000Z","updated_at":"2024-04-29T06:33:01.298Z","dependencies_parsed_at":"2023-02-17T14:30:30.990Z","dependency_job_id":"e5baaf82-94c2-4713-a2ab-aa5b2b75fc6a","html_url":"https://github.com/georgesmith46/bcbp","commit_stats":{"total_commits":439,"total_committers":5,"mean_commits":87.8,"dds":"0.24601366742596809","last_synced_commit":"a28bf238fcfc554967e731dc3d1c47e299598a16"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgesmith46%2Fbcbp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgesmith46%2Fbcbp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgesmith46%2Fbcbp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgesmith46%2Fbcbp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgesmith46","download_url":"https://codeload.github.com/georgesmith46/bcbp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223497731,"owners_count":17155199,"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":["barcode","boardingpass","iata"],"created_at":"2024-08-01T19:00:56.560Z","updated_at":"2024-11-07T10:30:17.917Z","avatar_url":"https://github.com/georgesmith46.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"![Build](https://img.shields.io/github/workflow/status/georgesmith46/bcbp/Release?style=for-the-badge)\n![License](https://img.shields.io/github/license/georgesmith46/bcbp?style=for-the-badge)\n![Bundlephobia](https://img.shields.io/bundlephobia/minzip/bcbp?style=for-the-badge)\n![Version](https://img.shields.io/npm/v/bcbp?style=for-the-badge)\n\n# BCBP\n\nEncoding/decoding library for the IATA Bar Coded Boarding Pass\n\n- Supports version 6 of the BCBP standard\n- Supports any number of legs\n\n## Getting started\n\n### Installation\n\nInstallation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```bash\n$ npm install bcbp\n```\n\n## Encode\n\n```ts\nencode(bcbp: BarcodedBoardingPass) =\u003e string\n```\n\n### Example\n\n```js\nimport { encode } from \"bcbp\";\n\nlet output = encode({\n  data: {\n    legs: [\n      {\n        operatingCarrierPNR: \"ABC123\",\n        departureAirport: \"YUL\",\n        arrivalAirport: \"FRA\",\n        operatingCarrierDesignator: \"AC\",\n        flightNumber: \"0834\",\n        flightDate: new Date(\"2020-08-13T00:00:00.000Z\"),\n        compartmentCode: \"F\",\n        seatNumber: \"001A\",\n        checkInSequenceNumber: \"0025\",\n        passengerStatus: \"1\",\n      },\n    ],\n    passengerName: \"DESMARAIS/LUC\",\n  },\n});\n\nconsole.log(output);\n// M1DESMARAIS/LUC       EABC123 YULFRAAC 0834 226F001A0025 106\u003e60000\n```\n\n## Decode\n\n```ts\ndecode(bcbp: string, referenceYear?: number) =\u003e BarcodedBoardingPass\n```\n\n### Example\n\n```js\nimport { decode } from \"bcbp\";\n\nlet output = decode(\n  \"M1DESMARAIS/LUC       EABC123 YULFRAAC 0834 226F001A0025 100\"\n);\n\nconsole.log(output.data.passengerName);\n// DESMARAIS/LUC\n```\n\n### Reference Year\n\nDefine the year which is used when parsing date fields. If this is undefined, the current year is used.\n\n```js\nimport { decode } from \"bcbp\";\n\nlet output = decode(\n  \"M1DESMARAIS/LUC       EABC123 YULFRAAC 0834 226F001A0025 100\",\n  2010\n);\n\nconsole.log(output.data.legs[0].flightDate.toISOString());\n// \"2010-08-14T00:00:00.000Z\"\n```\n\n# BarcodedBoardingPass\n\nSee [types.ts](src/types.ts) for the definition.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgesmith46%2Fbcbp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgesmith46%2Fbcbp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgesmith46%2Fbcbp/lists"}