{"id":15919682,"url":"https://github.com/0xadada/babel-typescript-playground","last_synced_at":"2026-01-27T00:39:17.226Z","repository":{"id":47423298,"uuid":"174602938","full_name":"0xadada/babel-typescript-playground","owner":"0xadada","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-03T17:30:39.000Z","size":143,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T18:54:40.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xadada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-08T20:14:40.000Z","updated_at":"2025-03-01T09:03:29.000Z","dependencies_parsed_at":"2023-02-01T08:17:03.885Z","dependency_job_id":null,"html_url":"https://github.com/0xadada/babel-typescript-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xadada/babel-typescript-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xadada%2Fbabel-typescript-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xadada%2Fbabel-typescript-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xadada%2Fbabel-typescript-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xadada%2Fbabel-typescript-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xadada","download_url":"https://codeload.github.com/0xadada/babel-typescript-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xadada%2Fbabel-typescript-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28794012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-06T19:02:28.725Z","updated_at":"2026-01-27T00:39:17.212Z","avatar_url":"https://github.com/0xadada.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel typescript playground\n\n_learning babel transforms and typescript._\n\n`@babel/core` is the core library.\n`@babel/cli` contains CLI tooling that consumes the core library.\n\n```bash\nyarn add -D @babel/core @babel/cli @babel/preset-env\nyarn add @babel/polyfill\n```\n\n## Try it\n\nTranspile `index.js` (ES2017) into ES5 and run `lib/index.js` in node.\n\n```bash\n$ npm run build:js\n$ npm run -s start\nhello,\nworld\n```\n\nTranspile `index.ts` (TypeScript) into ES5 and run `lib/index.js` in node.\n\n```bash\n$ npm run build:js\n$ npm run -s start\nhello,\nworld\n```\n\n## How it Works\n\n### Babel\n\nParse all the JavaScript files in the `src` directory, apply any transformations \nwe have told it to, and output each file to the `lib` directory.\n\nTransformations come in the form of plugins, which are small JavaScript programs \nthat instruct Babel on how to carry out transformations to the code.\n\nto use the arrow function transformation:\n```bash\nnpx babel src/ --out-dir lib/ --plugins=@babel/plugin-transform-arrow-functions \n```\n\nBabel also allows for presents, which are named sets of transformations:\n```bash\nnpx babel src/ --out-dir lib/ --presets=@babel/preset-env \n```\n\nConverts this ES2017:\n\n```js\nconst fn = (value) =\u003e value;\n```\n\ninto\n```js\n\"use strict\";\n\nvar fn = function fn(value) {\n  return value;\n};\n```\n\n### TypeScript\n\nTo handle typescript, add the `@babel/preset-typescript` plugin.\n```bash\nyarn add -D @babel/preset-typescript\n```\n\nGiven a TypeScript function:\n```TypeScript\nconst fn = (value : Number) : String =\u003e value.toString();\n```\n\nYou'll need to specify the `.ts` extension to specify the TypeScript file:\n\n```bash\n$ yarn -s babel --extensions \".ts\" example.ts\n\"use strict\";\n\nrequire(\"core-js/modules/es6.regexp.to-string\");\n\nvar fn = function fn(value) {\n  return value.toString();\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xadada%2Fbabel-typescript-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xadada%2Fbabel-typescript-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xadada%2Fbabel-typescript-playground/lists"}