{"id":18224943,"url":"https://github.com/iamsebastiandev/mjolnir","last_synced_at":"2025-04-10T18:44:56.796Z","repository":{"id":209728936,"uuid":"724795883","full_name":"IamSebastianDev/mjolnir","owner":"IamSebastianDev","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-01T06:49:34.000Z","size":569,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-03-24T16:34:47.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/IamSebastianDev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license.md","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-11-28T20:10:54.000Z","updated_at":"2024-11-29T14:57:06.000Z","dependencies_parsed_at":"2023-12-25T01:25:17.582Z","dependency_job_id":"823b02fc-43f2-4daf-b8dc-4505f75e6304","html_url":"https://github.com/IamSebastianDev/mjolnir","commit_stats":{"total_commits":66,"total_committers":2,"mean_commits":33.0,"dds":"0.16666666666666663","last_synced_commit":"ba4b2bb0a0e20ad2b0cbb04e1130256ea97639cc"},"previous_names":["iamsebastiandev/mjolnir"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamSebastianDev%2Fmjolnir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamSebastianDev%2Fmjolnir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamSebastianDev%2Fmjolnir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamSebastianDev%2Fmjolnir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IamSebastianDev","download_url":"https://codeload.github.com/IamSebastianDev/mjolnir/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271925,"owners_count":21075800,"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":[],"created_at":"2024-11-04T02:05:42.062Z","updated_at":"2025-04-10T18:44:56.751Z","avatar_url":"https://github.com/IamSebastianDev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- @format --\u003e\n\n# @iasd/Mjolnir\n\nCompiler for ValhallaScript. A completely ridiculous, unnecessary attempt at creating an esolang. I had my reasons.\n\n## Introduction\n\nMjolnir is a command-line tool for parsing ValhallaScript files (.vh) and converting them into JavaScript files (.js). ValhallaScript is an esoteric programming language inspired by Norse mythology, and this parser aims to make it easier to work with Valhalla script code.\n\n## Prerequisites\n\nBefore using the ValhallaScript Parser (Transpiler?), ensure you have the following dependencies installed:\n\n-   Node.js: You need Node.js installed on your system. You can download it from [nodejs.org](https://nodejs.org/).\n\n## Installation\n\n```bash\n$ yarn add @iasd/mjolnir\n# or\n$ npm install @iasd/mjolnir\n```\n\n## Usage\n\nYou can use the ValhallaScript Parser (Transpiler?) from the command line. Here's the basic usage:\n\n```bash\nyarn mjolnir --file=./index.vh --output=./build\n# or\nnpm mjolnir --file=./index.vh --output=./build\n```\n\n### Options\n\n-   `--file=\u003cinput\u003e`: Specifies the input `ValhallaScript` file.\n\n-   `--output=\u003coutput-dir\u003e`: Specify the output directory for the generated JavaScript file. By default, no output is created.\n\n-   `--temp=\u003ctemp-dir\u003e`: Specify a temporary directory for intermediate files. Default is `./.temp`.\n\n-   `--quiet`: Suppress informational messages.\n\n-   `--debug`: Enable debug mode, which includes additional logging.\n\n-   `--defer`: Defer execution of the generated JavaScript code. The JavaScript file will be created, but it won't be executed.\n\n-   `--pragma`: Add a pragma to the output\n\n### Example\n\nHere's an example of how to use the Valhalla Script Parser:\n\n```bash\nyarn mjolnir --file=index.vh --output=./build\n```\n\nIn this example, `index.vh` will be parsed, and the resulting JavaScript code will be saved in the `./build` directory. If the `--defer` option is not used, the JavaScript code will also be executed.\n\n### Hello World\n\nHere is a `Hello World` implementation.\n\n```vh\ncarve rune navn † `Fynn`; // create the variable 'navn'\nskæld∫inscribe\u003c»Hej « + navn\u003e; // logs `Hej Fynn`\n```\n\n## ValhallaScript Language\n\nValhallaScript is a unique esoteric programming language. It includes the following key features:\n\n-   `\u003c` and `\u003e`: Represent opening and closing parentheses.\n-   `(*)`: Translates to `=\u003e` in JavaScript.\n-   `†`: Translates to `=` in JavaScript.\n-   `carve rune`: Translates to `let` in JavaScript.\n-   `carve saga`: Translates to `const` in JavaScript.\n-   `«` and `»`: Represent a string as a JavaScript backtick.\n-   `∆∞` \u0026 `∞∆`: Represents square brackets.\n-   `∫`: Represents the property access `.`\n-   `\u003c∂` \u0026 `∂\u003e`: Represents curly braces.\n-   `ansuz` \u0026 `hagalaz`: Represents `true` \u0026 `false` respectively.\n-   `∑` \u0026 `!∑`: Represents `if` \u0026 `else`.\n-   `mimir` \u0026 `from`: Represents `for...of` to start a for...of loop\n\n## Escaping\n\nPreceding any of the provided tokens / keywords with an `ø` will escape the character and stop the transpilation.\n\n## ValhallaScript Standard Library\n\nA certain set of functions are imported by default. No other imports are available (as of yet. Probably never.)\n\n-   `skæld`: Transpiles to `console` in JavaScript.\n-   `inscribe`: Transpiles to `log` in JavaScript.\n-   `runestone`: Transpiles to `Object` in JavaScript.\n    -   `runestone∫futhark`: Transpiles to `Object.fromEntries`\n    -   `runestone∫glyphs`: Transpiles to `Object.entries`\n    -   `runestone∫sigils`: Transpiles to `Object.keys`\n    -   `runestone∫essence`: Transpiles to `Object.values`\n-   `freyasOath`: Transpiles to `new Promise` in JavaScript\n-   `scry` \u0026 `woven`: Transpiles to `async` \u0026 `await`\n-   `destine`: Transpiles to `return`\n-   `choose`, `path` \u0026 `rest`: Transpiles to `switch`, `case` and `break`\n\n### File Api\n\nA certain set of fns are provided to handle files.\n\n#### `eddaEtch`\n\nType: `(handle: string, content: string) =\u003e Promise\u003cvoid\u003e``\n\nDescription:  \n`eddaEtch` is an asynchronous function that creates a file at the specified location with the specified content. It accepts two parameters:\n\nhandle (type: `string`): The file path where you want to create the file.  \ncontent (type: `string`): The content you want to write to the file.\n\nUsage:\n\n```vh\nscry eddaEtch\u003c»./file.txt«, »File Content«\u003e\n```\n\nReturns:  \nA promise that resolves when the file has been successfully created with the provided content. If any errors occur during the process, it will reject with an error message.\n\n#### `eddaSeek`\n\nType: (handle: `string`) =\u003e Promise\u003cstring\u003e\n\nDescription:  \n`eddaSeek` is an asynchronous function that reads and retrieves the content of a file located at the specified path. It accepts one parameter:\n\nhandle (type: `string`): The file path from which you want to read the content.\nUsage:\n\n```vh\nscry eddaSeek\u003c»./file.txt«\u003e\n```\n\nReturns:  \nA promise that resolves with the content of the file as a string if the file exists and can be read. If the file does not exist or an error occurs during the process, it will reject with an error message.\n\n#### `eddaWeave`\n\nType: `(handle: string, content: string) =\u003e Promise\u003cvoid\u003e``\n\nDescription:  \neddaWeave is an asynchronous function that appends the specified content to a file located at the specified path. It accepts two parameters:\n\nhandle (type: `string`): The file path to which you want to append the content.  \ncontent (type: `string`): The content you want to append to the file.\n\nUsage:\n\n```vh\nscry eddaWeave\u003c»./file.txt«, »Additional Content«\u003e\n```\n\nReturns:  \nA promise that resolves when the content has been successfully appended to the file. If any errors occur during the process, it will reject with an error message.\n\n#### `eddaExile`\n\nType: `(handle: string) =\u003e Promise\u003cvoid\u003e``\n\nDescription:  \neddaExile is an asynchronous function that deletes a file or directory located at the specified path. It accepts one parameter:\n\nhandle (type: `string`): The file or directory path you want to delete.\nUsage:\n\n```vh\nscry eddaExile\u003c»./file.txt«\u003e\n```\n\nReturns:  \nA promise that resolves when the file or directory has been successfully deleted. If any errors occur during the deletion process, it will reject with an error message.\n\n### Path Api\n\nSet of functions to interact with paths\n\n#### `root`\n\nType: `(...fragments: string[]) =\u003e Promise\u003cstring\u003e``\n\nDescription: function to create a absolute path from the root of the process.\n\nUsage:\n\n```vh\nroot\u003c»./folder«, »file.txt«\u003e\n// results in ./path/to/process/folder/file.txt\n```\n\n## Contributing\n\nIf you would like to contribute, take a look at the [Contribution Guide](./contributing.md). Contributors of any skill level are\nappreciated, if you have any questions, feel free to reach out.\n\n## License\n\n`Mjolnir` is licensed under the [MIT License](https://opensource.org/licenses/MIT)\n\n## Acknowledgments\n\nValhalla Script Parser uses the following open-source libraries:\n\n-   [chalk](https://www.npmjs.com/package/chalk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamsebastiandev%2Fmjolnir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamsebastiandev%2Fmjolnir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamsebastiandev%2Fmjolnir/lists"}