{"id":20811650,"url":"https://github.com/slye3d/esy-language","last_synced_at":"2025-05-07T10:05:03.498Z","repository":{"id":57230657,"uuid":"94102365","full_name":"Slye3D/esy-language","owner":"Slye3D","description":"Esy is a new JS preprocessor allows you to use custom block structures.","archived":false,"fork":false,"pushed_at":"2017-09-06T13:24:17.000Z","size":267,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-16T20:01:42.299Z","etag":null,"topics":["blocks","code-structure","compiler","esy","javascript","language","preprocessor","slye"],"latest_commit_sha":null,"homepage":"","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/Slye3D.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-12T13:59:24.000Z","updated_at":"2023-09-20T16:59:01.000Z","dependencies_parsed_at":"2022-09-01T21:51:00.864Z","dependency_job_id":null,"html_url":"https://github.com/Slye3D/esy-language","commit_stats":null,"previous_names":["slye-team/esy-language"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slye3D%2Fesy-language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slye3D%2Fesy-language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slye3D%2Fesy-language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slye3D%2Fesy-language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Slye3D","download_url":"https://codeload.github.com/Slye3D/esy-language/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225088975,"owners_count":17419228,"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":["blocks","code-structure","compiler","esy","javascript","language","preprocessor","slye"],"created_at":"2024-11-17T20:45:50.618Z","updated_at":"2024-11-17T20:45:51.318Z","avatar_url":"https://github.com/Slye3D.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Esy\n\n[![NPM](https://nodei.co/npm/esy-language.png?compact=true)](https://npmjs.org/package/esy-language)\n\n[![CircleCI](https://circleci.com/gh/Slye-team/esy-language/tree/master.svg?style=shield)](https://circleci.com/gh/Slye-team/esy-language/tree/master)\n[![npm version](https://badge.fury.io/js/esy-language.svg)](https://badge.fury.io/js/esy-language)\n[![downloads](https://img.shields.io/npm/dt/esy-language.svg)](https://www.npmjs.com/package/badges)\n[![dependencies](https://img.shields.io/david/slye-team/esy-language.svg)](https://www.npmjs.com/package/badges)\n[![license](https://img.shields.io/npm/l/esy-language.svg)](./LICENSE)\n[![Join the chat at https://gitter.im/Slye-team/esy-language](https://badges.gitter.im/Slye-team/esy-language.svg)](https://gitter.im/Slye-team/esy-language?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n![Esy Logo](./logo.png)\n\nEsy is a new JS preprocessor allows you to use custom block structures.\n\n# What does it mean?\n Right now in JavaScript and many other languages that support the [block structure](https://en.wikipedia.org/wiki/Scope_(computer_science)#Block_scope), you're only able to use some predefined structures like:\n\n 1. if (){...}\n 2. for (){...}\n 3. while (){...}\n 4. do {...} while();\n 5. switch (){...}\n 6. else {...}\n 7. try {...}\n 8. catch (){...}\n 9. finally (){...}\n 10. etc...\n\n Those are all familiar structures to you, but have you ever thought about the following structure?\n ```esy\n timeout 200 {\n    console.log(\"Hello World!\");\n }\n ```\n Certainly, it's easier than what we have in `JS` right now:\n ```js\n setTimeout(function() {\n    console.log(\"Hello World!\");\n }, 200);\n ```\n Or even with `arrow functions`:\n```js\n setTimeout(() =\u003e {\n    console.log(\"Hello World!\");\n }, 200);\n ```\n That why `Esy` comes from `Easy`\n\n# Install\n  You can install this package globally by running:\n  ```bash\n  npm install esy-language -g\n  ```\n  but if you're interested in the core API and wants to use it in your own package just run:\n  ```bash\n  npm install esy-language --save\n  ```\n\n# Example\n  After installing the `Esy`, save this file as `ex.esy`\n  ```esy\n  // Cache sum for 500ms\n  cache 500 sum(a,b){\n  \tconsole.log('Computing...');\n  \treturn a+b;\n  } key (c,d){\n  \t// We don't care about numbers order in sum function (a+b=b+a)\n  \treturn [c, d].sort();\n  }\n\n  // Compute 5+7 once\n  console.log(sum(5,7))\n\n  // Load theme from cache without computing\n  console.log(sum(5,7))\n  console.log(sum(7,5))\n\n  // Wait 100ms more than cache's lifetime.\n  timeout 600{\n  \t// It should compute 5+7 again\n  \tconsole.log(sum(7,5))\n  }\n  ```\n  and then cd to the directory that your file is and run this command to run program:\n  ```\n  esy ex.esy\n  ```\n  for saving result to a file run:\n  ```\n  esy compile ex.esy -s\n  ```\n\n# Docs\n  Read [official docs](https://github.com/Slye-team/esy-language/tree/master/docs) for more details.\n\n# Testing\n  To run tests just run:\n  ```bash\n  git clone https://github.com/Slye-team/esy-language.git\n  cd esy-language\n  npm run test\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslye3d%2Fesy-language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslye3d%2Fesy-language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslye3d%2Fesy-language/lists"}