{"_id":"@anandacahya/steviour","_rev":"3-3049d29ff4ba8a03674b6738f92c502b","name":"@anandacahya/steviour","dist-tags":{"latest":"1.2.1"},"versions":{"1.1.0":{"name":"@anandacahya/steviour","version":"1.1.0","keywords":[],"author":"","license":"ISC","_id":"@anandacahya/steviour@1.1.0","maintainers":[{"name":"anandacahya","email":"tgigroupjap@gmail.com"}],"homepage":"https://github.com/AnandaCahya/steviour#readme","bugs":{"url":"https://github.com/AnandaCahya/steviour/issues"},"bin":{"steviour":"steviour.js"},"dist":{"shasum":"a966ff5d90bc4f390d831bb0fad1ad065eba308b","tarball":"https://registry.npmjs.org/@anandacahya/steviour/-/steviour-1.1.0.tgz","fileCount":4,"integrity":"sha512-qwhVWGd8SG57MnLONU1FveqPU1rLWEkHHs6A8da4QbAdhfPvpb4T97NqzhRdLFMDAknAq9Ug09lBxN7bwgoVlw==","signatures":[{"sig":"MEQCIEmd6FVgh15LnQxigjVZBZNilfTJPskTeLowm1osQWyZAiAJILFWNRLI79+TQ2qeUZWsiad846HbRu3SRDtoz/UrQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10307},"main":"steviour.js","gitHead":"4707607b590a797045160a6be5df851e82a9bf3d","scripts":{"test":"echo \"Success, It's testing\""},"_npmUser":{"name":"anandacahya","email":"tgigroupjap@gmail.com"},"repository":{"url":"git+https://github.com/AnandaCahya/steviour.git","type":"git"},"_npmVersion":"10.8.2","description":"CLI for managing Steviour server","directories":{},"_nodeVersion":"20.19.1","dependencies":{"chalk":"^4.1.2","yargs":"^17.7.2","cfonts":"^3.3.0","colors":"^1.4.0","dotenv":"^16.5.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/steviour_1.1.0_1747791907815_0.7385642772438914","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@anandacahya/steviour","version":"1.2.0","keywords":[],"author":"","license":"ISC","_id":"@anandacahya/steviour@1.2.0","maintainers":[{"name":"anandacahya","email":"tgigroupjap@gmail.com"}],"homepage":"https://github.com/AnandaCahya/steviour#readme","bugs":{"url":"https://github.com/AnandaCahya/steviour/issues"},"bin":{"steviour":"steviour.js"},"dist":{"shasum":"de77c49b605313650afbd339985b8a003cb2dee5","tarball":"https://registry.npmjs.org/@anandacahya/steviour/-/steviour-1.2.0.tgz","fileCount":12,"integrity":"sha512-CFm6sSv5BKTm92vZqbilHehp9pD1e0mDu+HMlX/UK6DEtMa1AM/diH0gJMnB5jyEj3ZKzsio0oTr80wr0+RfCw==","signatures":[{"sig":"MEQCIE0ajQiGXbQL/SHOQHBXgUxmh2HpePpfS3uys9WNqUgEAiAQsTbMsHErUjeJIVah6vIsO7Oa9+qmD9peaV8+9AShUg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17249},"main":"steviour.js","gitHead":"685cd90c21ee8ee8f80c6721fb71040bebfd8277","scripts":{"test":"echo \"Success, It's testing\""},"_npmUser":{"name":"anandacahya","email":"tgigroupjap@gmail.com"},"repository":{"url":"git+https://github.com/AnandaCahya/steviour.git","type":"git"},"_npmVersion":"10.8.2","description":"CLI for managing Steviour server","directories":{},"_nodeVersion":"20.19.1","dependencies":{"chalk":"^4.1.2","yargs":"^17.7.2","cfonts":"^3.3.0","colors":"^1.4.0","dotenv":"^16.5.0","chokidar":"^4.0.3"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/steviour_1.2.0_1747960446176_0.7976932149361433","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@anandacahya/steviour","version":"1.2.1","main":"steviour.js","bin":{"steviour":"steviour.js"},"scripts":{"test":"echo \"Success, It's testing\""},"author":"","license":"ISC","description":"CLI tool for managing sharded or multi-runtime applications with simple configuration and automatic process handling.","keywords":["sharding","process-manager","multi-runtime","cli"],"dependencies":{"cfonts":"^3.3.0","chalk":"^4.1.2","chokidar":"^4.0.3","colors":"^1.4.0","dotenv":"^16.5.0","yargs":"^17.7.2"},"repository":{"type":"git","url":"git+https://github.com/AnandaCahya/steviour.git"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_id":"@anandacahya/steviour@1.2.1","gitHead":"ff592d8f4e0c313490a8817ba7b0091e8c12bc81","bugs":{"url":"https://github.com/AnandaCahya/steviour/issues"},"homepage":"https://github.com/AnandaCahya/steviour#readme","_nodeVersion":"20.19.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-+dCaztoNPvCBlj+zoWR2zTuB2yowH+0iVIH6OoKpr4hCoe24q0k2vEKqJybTYy6QXLjhhrNJrl/BH3aeYVoH1Q==","shasum":"d114ef45f7ad993c8eccc00c8abbb2f93077590f","tarball":"https://registry.npmjs.org/@anandacahya/steviour/-/steviour-1.2.1.tgz","fileCount":13,"unpackedSize":18654,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICPShXNYxPT6hx4BnCNYJ/zndbldU0gKIGTygWZ1UaNxAiEAhe9C8qfegqrFR7/voWIpJ1lOSjK1hPTzSMLO7kDpYz4="}]},"_npmUser":{"name":"anandacahya","email":"tgigroupjap@gmail.com"},"directories":{},"maintainers":[{"name":"anandacahya","email":"tgigroupjap@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/steviour_1.2.1_1748052859379_0.17479503994881807"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-21T01:45:07.732Z","modified":"2025-05-24T02:14:19.763Z","1.1.0":"2025-05-21T01:45:08.021Z","1.2.0":"2025-05-23T00:34:06.375Z","1.2.1":"2025-05-24T02:14:19.592Z"},"bugs":{"url":"https://github.com/AnandaCahya/steviour/issues"},"license":"ISC","homepage":"https://github.com/AnandaCahya/steviour#readme","keywords":["sharding","process-manager","multi-runtime","cli"],"repository":{"type":"git","url":"git+https://github.com/AnandaCahya/steviour.git"},"description":"CLI tool for managing sharded or multi-runtime applications with simple configuration and automatic process handling.","maintainers":[{"name":"anandacahya","email":"tgigroupjap@gmail.com"}],"readme":"# Steviour\n\n# Steviour\n\n[![npm version](https://img.shields.io/npm/v/@anandacahya/steviour)](https://www.npmjs.com/package/@anandacahya/steviour)\n[![npm downloads](https://img.shields.io/npm/dt/@anandacahya/steviour)](https://www.npmjs.com/package/@anandacahya/steviour)\n\n**Steviour** is a Node.js-based CLI tool designed to generate server configuration files (`steviour.json`) and manage application runtimes using a lightweight sharding system. It spawns multiple process instances based on your selected runtime/compiler (e.g., Node.js, Python, Ruby). Steviour features automatic restarts on failure and displays system information at startup, making it ideal for running sharded or multi-process applications such as bots, microservices, or background workers across multiple CPU cores.\n\n---\n\n## Installation\n\n```bash\nnpm i steviour -g\n```\n\n---\n\n## Getting Started\n\n### Initialize Configuration\n\nUse the following command to generate an initial server configuration in your project:\n\n#### Command\n\n```bash\nsteviour.js init [compiler]\n```\n\nExample:\n\n```bash\nsteviour init --serverName=asia-1\n```\n\nThis will generate a default `steviour.json` file like this:\n\n```json\n{\n  \"serverName\": \"DESKTOP-TBC69PH\",\n  \"name\": \"Backend-Odading\",\n  \"author\": \"ananda\",\n  \"main\": \"index.js\",\n  \"shardScheme\": {\n    \"total\": 1\n  }\n}\n```\n\nYou can replace `main` with `script` if using a custom runtime:\n\n```json\n{\n  \"script\": \"python index.py\"\n}\n```\n\nOr another language:\n\n```json\n{\n  \"script\": \"ruby index.rb\"\n}\n```\n\n#### Positional Arguments\n\n* `compiler`: Specifies the programming language or compiler to use.\n  **Options:** `\"node\"`, `\"python\"`, `\"ruby\"`\n  **Default:** `\"node\"`\n\n#### Options\n\n| Option          | Alias | Description                                            | Type    | Default |\n| --------------- | ----- | ------------------------------------------------------ | ------- | ------- |\n| `--version`     |       | Display the current version of `steviour.js`           | boolean |         |\n| `--help`        |       | Show help message                                      | boolean |         |\n| `--serverName`  | `-s`  | Set the server name manually                           | string  |         |\n| `--shardLength` |       | Set the number of total shards                         | number  |         |\n| `--force`       | `-f`  | Force overwrite if a configuration file already exists | boolean | `false` |\n\n#### Usage Examples\n\n```bash\n# Initialize with the default (Node.js)\nsteviour.js init\n\n# Initialize with Python\nsteviour.js init python\n\n# Initialize with server name and specific shard count\nsteviour.js init node -s asia1 --shardLength 5\n\n# Force initialization (overwrite existing config)\nsteviour.js init --force\n```\n\n---\n\n## Configuration File (`steviour.json`)\n\nHere’s a complete example configuration:\n\n```json\n{\n  \"serverName\": \"DESKTOP-TBC69PH\",\n  \"name\": \"Backend-Odading\",\n  \"author\": \"ananda\",\n  \"main\": \"index.js\",\n  \"compiler\": \"node\",\n  \"shardScheme\": {\n    \"total\": 1,\n    \"delay\": 4000\n  },\n  \"autoRestart\": true,\n  \"restartDelay\": 2500\n}\n```\n\n**Configuration Fields Explained:**\n\n* `main`: Entry file for Node.js (use `script` for other runtimes)\n* `compiler`: Language runtime used (`node`, `python`, `ruby`)\n* `shardScheme.total`: Total number of shards to spawn\n* `shardScheme.delay`: Delay between spawning each shard (in ms)\n* `autoRestart`: Automatically restart the process on failure (default: true)\n* `restartDelay`: Delay before restarting a failed process (in ms)\n\n---\n\n## Shard Environment Variables\n\nWhen your app runs, Steviour sets the following environment variables:\n\n| ENV Variable         | Description             | Type   |\n| -------------------- | ----------------------- | ------ |\n| `SYSTEM_ID`          | Shard ID                | Number |\n| `SYSTEM_NAME`        | Unique shard identifier | String |\n| `SYSTEM_SERVERNAME`  | Hostname / server name  | String |\n| `SYSTEM_SHARDLENGTH` | Total number of shards  | Number |\n\n---\n\n## Running Steviour\n\nRun the application from your project directory:\n\n```bash\nsteviour run\n```\n\n### Running a Specific Shard\n\nTo run a specific shard manually (ignoring the `shardScheme.total`):\n\n```bash\nsteviour run --shardId=12\n```\n\nUseful for custom shard managers or debugging single shards.\n\n### Development Mode\n\nEnable auto-restart on file changes (great for development and testing):\n\n```bash\nsteviour run --dev\n```\n\n### Example usage in your code\n\n#### Example Code Using Steviour\n\nBelow are simple runtime examples in **Node.js** and **Python** that can be managed using **Steviour** with environment-based sharding.\n\n---\n\n##### Node.js Example (`index.js`)\n\n```js\n// index.js\nconsole.log('🟢 Node Shard Running');\nconsole.log('🧩 Environment Info:');\nconsole.log(`- SYSTEM_ID: ${process.env.SYSTEM_ID}`);\nconsole.log(`- SYSTEM_NAME: ${process.env.SYSTEM_NAME}`);\nconsole.log(`- SYSTEM_SERVERNAME: ${process.env.SYSTEM_SERVERNAME}`);\nconsole.log(`- SYSTEM_SHARDLENGTH: ${process.env.SYSTEM_SHARDLENGTH}`);\n\n// Simulate workload\nsetInterval(() => {\n  console.log(`Shard ${process.env.SYSTEM_ID} is doing work...`);\n}, 3000);\n```\n\n##### Sample `steviour.json` Configuration for Node.js:\n\n```json\n{\n  \"serverName\": \"localhost-node\",\n  \"name\": \"NodeExample\",\n  \"author\": \"ananda\",\n  \"main\": \"index.js\",\n  \"compiler\": \"node\",\n  \"shardScheme\": {\n    \"total\": 3,\n    \"delay\": 2000\n  },\n  \"autoRestart\": true,\n  \"restartDelay\": 1000\n}\n```\n\n---\n\n##### Python Example (`index.py`)\n\n```python\n# index.py\nimport os\nimport time\n\nprint(\"🟢 Python Shard Running\")\nprint(\"🧩 Environment Info:\")\nprint(f\"- SYSTEM_ID: {os.getenv('SYSTEM_ID')}\")\nprint(f\"- SYSTEM_NAME: {os.getenv('SYSTEM_NAME')}\")\nprint(f\"- SYSTEM_SERVERNAME: {os.getenv('SYSTEM_SERVERNAME')}\")\nprint(f\"- SYSTEM_SHARDLENGTH: {os.getenv('SYSTEM_SHARDLENGTH')}\")\n\n# Simulate workload\nwhile True:\n    print(f\"Shard {os.getenv('SYSTEM_ID')} is doing work...\")\n    time.sleep(3)\n```\n\n##### Sample `steviour.json` Configuration for Python:\n\n```json\n{\n  \"serverName\": \"localhost-python\",\n  \"name\": \"PythonExample\",\n  \"author\": \"ananda\",\n  \"script\": \"python index.py\",\n  \"compiler\": \"python\",\n  \"shardScheme\": {\n    \"total\": 3,\n    \"delay\": 2000\n  },\n  \"autoRestart\": true,\n  \"restartDelay\": 1000\n}\n```\n","readmeFilename":"README.md"}