akro-lang 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,36 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ankitkhileryy (Creator and Owner of Akro Programming Language)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ IMPORTANT NOTICE:
26
+ Akro Programming Language is an original work created by ankitkhileryy.
27
+ The name "Akro", the language design, syntax, and implementation
28
+ are intellectual property of ankitkhileryy.
29
+
30
+ If you use, fork, or build upon Akro, you MUST:
31
+ - Keep this copyright notice in all copies
32
+ - Credit ankitkhileryy as the original creator
33
+ - Not claim ownership of the original language
34
+
35
+ Akro was created in 2026 by ankitkhileryy.
36
+ GitHub: https://github.com/ankitkhileryy/akro
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # akro-lang
2
+
3
+ > ⚡ Akro Programming Language — Fast. Simple. Web-Ready.
4
+
5
+ Created by **ST** | [akro-lang.dev](https://akro-lang.dev)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g akro-lang
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ akro run main.ak # Run a file
17
+ akro repl # Interactive shell
18
+ akro transpile main.ak # Convert to JavaScript
19
+ akro version # Show version
20
+ ```
21
+
22
+ ## Example
23
+
24
+ Create `hello.ak`:
25
+ ```
26
+ fn main {
27
+ name := "World"
28
+ say "Hello, {name}!"
29
+ }
30
+ ```
31
+
32
+ Run it:
33
+ ```bash
34
+ akro run hello.ak
35
+ # Hello, World!
36
+ ```
37
+
38
+ ## Node.js API
39
+
40
+ ```js
41
+ const akro = require('akro-lang');
42
+
43
+ // Run a file
44
+ akro.run('main.ak');
45
+
46
+ // Transpile to JS
47
+ const js = akro.transpile('app.ak');
48
+
49
+ // Get version
50
+ console.log(akro.version());
51
+ ```
52
+
53
+ ## License
54
+
55
+ MIT © 2026 ankitkhileryy
Binary file
package/bin/akro.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ // Akro Language - npm CLI wrapper
3
+ // Copyright (c) 2026 ST - Creator of Akro
4
+ // https://github.com/ST/akro
5
+
6
+ const { execFileSync } = require('child_process');
7
+ const path = require('path');
8
+ const os = require('os');
9
+ const fs = require('fs');
10
+
11
+ // Find the akro binary
12
+ function getAkroBinary() {
13
+ const platform = os.platform();
14
+ const binDir = path.join(__dirname, '..', 'bin');
15
+
16
+ if (platform === 'win32') {
17
+ return path.join(binDir, 'akro-win.exe');
18
+ } else if (platform === 'darwin') {
19
+ return path.join(binDir, 'akro-mac');
20
+ } else {
21
+ return path.join(binDir, 'akro-linux');
22
+ }
23
+ }
24
+
25
+ const binary = getAkroBinary();
26
+
27
+ if (!fs.existsSync(binary)) {
28
+ console.error('Akro binary not found for your platform.');
29
+ console.error('Please report this issue at: https://github.com/ST/akro/issues');
30
+ process.exit(1);
31
+ }
32
+
33
+ // Pass all arguments to the binary
34
+ try {
35
+ execFileSync(binary, process.argv.slice(2), {
36
+ stdio: 'inherit',
37
+ env: process.env
38
+ });
39
+ } catch (err) {
40
+ process.exit(err.status || 1);
41
+ }
package/lib/index.js ADDED
@@ -0,0 +1,62 @@
1
+ // Akro Language - Node.js API
2
+ // Copyright (c) 2026 ST - Creator of Akro
3
+
4
+ const { execFileSync, execFile } = require('child_process');
5
+ const path = require('path');
6
+ const os = require('os');
7
+ const fs = require('fs');
8
+
9
+ function getAkroBinary() {
10
+ const platform = os.platform();
11
+ const binDir = path.join(__dirname, '..', 'bin');
12
+ if (platform === 'win32') return path.join(binDir, 'akro-win.exe');
13
+ if (platform === 'darwin') return path.join(binDir, 'akro-mac');
14
+ return path.join(binDir, 'akro-linux');
15
+ }
16
+
17
+ const binary = getAkroBinary();
18
+
19
+ /**
20
+ * Run an Akro source file
21
+ * @param {string} filePath - Path to .ak file
22
+ * @returns {string} output
23
+ */
24
+ function run(filePath) {
25
+ return execFileSync(binary, ['run', filePath], {
26
+ encoding: 'utf8'
27
+ });
28
+ }
29
+
30
+ /**
31
+ * Transpile Akro code to JavaScript
32
+ * @param {string} filePath - Path to .ak file
33
+ * @returns {string} JavaScript code
34
+ */
35
+ function transpile(filePath) {
36
+ return execFileSync(binary, ['transpile', filePath], {
37
+ encoding: 'utf8'
38
+ });
39
+ }
40
+
41
+ /**
42
+ * Check Akro code for errors
43
+ * @param {string} filePath - Path to .ak file
44
+ * @returns {string} check result
45
+ */
46
+ function check(filePath) {
47
+ return execFileSync(binary, ['check', filePath], {
48
+ encoding: 'utf8'
49
+ });
50
+ }
51
+
52
+ /**
53
+ * Get Akro version
54
+ * @returns {string} version string
55
+ */
56
+ function version() {
57
+ return execFileSync(binary, ['version'], {
58
+ encoding: 'utf8'
59
+ }).trim();
60
+ }
61
+
62
+ module.exports = { run, transpile, check, version };
package/lib/install.js ADDED
@@ -0,0 +1,35 @@
1
+ // Akro Language - Post-install script
2
+ // Copyright (c) 2026 ST
3
+
4
+ const os = require('os');
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+
8
+ const platform = os.platform();
9
+ const binDir = path.join(__dirname, '..', 'bin');
10
+
11
+ console.log('\n ⚡ Akro Programming Language v0.1.0');
12
+ console.log(' Created by ST\n');
13
+
14
+ // Make binary executable on Unix
15
+ if (platform !== 'win32') {
16
+ const binary = platform === 'darwin'
17
+ ? path.join(binDir, 'akro-mac')
18
+ : path.join(binDir, 'akro-linux');
19
+
20
+ if (fs.existsSync(binary)) {
21
+ fs.chmodSync(binary, '755');
22
+ console.log(' ✓ Binary permissions set');
23
+ }
24
+ }
25
+
26
+ console.log(' ✓ Akro installed successfully!');
27
+ console.log('');
28
+ console.log(' Usage:');
29
+ console.log(' akro run main.ak - Run a file');
30
+ console.log(' akro repl - Interactive shell');
31
+ console.log(' akro transpile main.ak - Convert to JS');
32
+ console.log(' akro version - Show version');
33
+ console.log('');
34
+ console.log(' Docs: https://akro-lang.dev');
35
+ console.log('');
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "akro-lang",
3
+ "version": "0.1.0",
4
+ "description": "Akro Programming Language - Fast, Simple, Web-Ready. Created by ankitkhileryy",
5
+ "author": "ankitkhileryy",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "akro",
9
+ "akro-lang",
10
+ "programming-language",
11
+ "language",
12
+ "compiler",
13
+ "interpreter",
14
+ "transpiler",
15
+ "ankitkhileryy"
16
+ ],
17
+ "homepage": "https://github.com/ankitkhileryy/akro",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/ankitkhileryy/akro.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/ankitkhileryy/akro/issues"
24
+ },
25
+ "bin": {
26
+ "akro": "bin/akro.js"
27
+ },
28
+ "main": "./lib/index.js",
29
+ "files": [
30
+ "bin/",
31
+ "lib/",
32
+ "README.md",
33
+ "LICENSE"
34
+ ],
35
+ "engines": {
36
+ "node": ">=16.0.0"
37
+ },
38
+ "scripts": {
39
+ "postinstall": "node lib/install.js"
40
+ }
41
+ }