{"id":15007721,"url":"https://github.com/linuxfandudeguy/cnsh","last_synced_at":"2026-03-09T18:05:50.998Z","repository":{"id":255580490,"uuid":"850848777","full_name":"linuxfandudeguy/cnsh","owner":"linuxfandudeguy","description":"A lightweight package manager based on Yarn.","archived":false,"fork":false,"pushed_at":"2024-09-28T18:05:17.000Z","size":559,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T06:15:02.022Z","etag":null,"topics":["ecmascript","ecmascript-modules","esm","esmodule","esmodules","node","node-js","nodejs","npm","npm-module","npm-package","package-manager","yarn","yarnpkg"],"latest_commit_sha":null,"homepage":"https://cnsh-website.vercel.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxfandudeguy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-02T00:05:11.000Z","updated_at":"2024-09-28T18:05:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"4951cf88-d851-4ad7-8fdb-054429eb17b8","html_url":"https://github.com/linuxfandudeguy/cnsh","commit_stats":null,"previous_names":["linuxfandudeguy/cnsh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linuxfandudeguy/cnsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fcnsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fcnsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fcnsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fcnsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxfandudeguy","download_url":"https://codeload.github.com/linuxfandudeguy/cnsh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fcnsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30305964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T17:35:44.120Z","status":"ssl_error","status_checked_at":"2026-03-09T17:35:43.707Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ecmascript","ecmascript-modules","esm","esmodule","esmodules","node","node-js","nodejs","npm","npm-module","npm-package","package-manager","yarn","yarnpkg"],"created_at":"2024-09-24T19:13:31.367Z","updated_at":"2026-03-09T18:05:50.959Z","avatar_url":"https://github.com/linuxfandudeguy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# cnsh\n            \n\u003cimg src=\"assets/logo.svg\" alt=\"cnsh logo\" class=\"lol\"\u003e\n\n[![npm version](https://img.shields.io/npm/v/cnsh)](https://www.npmjs.com/package/cnsh)\n[![npm downloads](https://img.shields.io/npm/dt/cnsh)](https://www.npmjs.com/package/cnsh)\n[![License](https://img.shields.io/npm/l/cnsh)](https://opensource.org/licenses/MIT)\n[![Coverage Status](https://img.shields.io/coveralls/linuxfandudeguy/cnsh)](https://coveralls.io/github/linuxfandudeguy/cnsh)\n[![GitHub stars](https://img.shields.io/github/stars/linuxfandudeguy/cnsh?style=social)](https://github.com/linuxfandudeguy/cnsh/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/linuxfandudeguy/cnsh?style=social)](https://github.com/linuxfandudeguy/cnsh/network)\n\n`cnsh` is a lightweight package manager that provides a minimal alternative to Yarn. It fetches packages from the npm registry and installs them in a simplified directory structure.\n\n## Features\n\n- **Add Packages**: Install packages from the npm registry.\n- **Remove Packages**: Uninstall packages from your project.\n- **Install Dependencies**: Install all dependencies listed in `package.json`.\n- **Global and Local Installation**: Supports both global and local package management.\n- **Simple and Efficient**: Focuses on essential features for ease of use.\n\n## Installation\n\nTo install `cnsh` globally, follow these steps:\n\n1. **Install via pnpm**\n\n   Run the following command in your terminal:\n\n   ```bash\n   pnpm install -g cnsh --verbose\n   ```\n\n   This will install `cnsh` globally, making it available from any directory on your system.\n\n2. **Verify Installation**\n\n   To check if `cnsh` is installed correctly, run:\n\n   ```bash\n   cnsh\n   ```\n\n\n\n   If `cnsh` is installed, you should see the following output in red text along with the output from the `--help` command:\n\n```mathematica\nUnknown command.\n```\n\n   This confirms that `cnsh` is properly installed and recognizing commands.\n\n## Usage\n\n`cnsh` offers a simple set of commands for managing packages. Here’s how to use it:\n\n### Adding a Package\n\nTo add a package to your project, use:\n\n```bash\ncnsh add \u003cpackage-name\u003e --verbose\n```\n\u003e ###### the verbose flag is optional, it is used to display more information\n\nFor example, to add `lodash`:\n\n```bash\ncnsh add lodash --verbose\n```\n\nThis installs `lodash` into your project's `cnsh_lib` directory.\n\n### Updating\n \nTo update it, run this command in your terminal:\n\n```bash\npnpm install -g cnsh@latest\n```\n\n### Removing a Package\n\nTo remove a package, use:\n\n```bash\ncnsh remove \u003cpackage-name\u003e\n```\n\nFor example, to remove `lodash`:\n\n```bash\ncnsh remove lodash\n```\n\n### Installing Dependencies\n\nTo install all dependencies listed in your `package.json`, use:\n\n```bash\ncnsh install\n```\n\nThis reads the `package.json` file and installs all listed dependencies into your `cnsh_lib` directory.\n\n### Global Installation\n\nTo install a package globally, use:\n\n```bash\ncnsh add -g \u003cpackage-name\u003e\n```\n\nGlobal packages will be installed in a global directory (typically `~/.cnsh-global/cnsh_lib`).\n\n### Help\n\nFor a list of available commands and help, use:\n\n```bash\ncnsh --help\n```\n\n\n## Example: Using `axios` with `cnsh`\n\nHere’s a demonstration of how to use `axios` with `cnsh`:\n\n1. **Install `axios`**\n\n   ```bash\n   cnsh add axios\n   ```\n\n2. **Create a Simple Node.js Script**\n\n   Create a file named `app.js` with the following content:\n\n   ```javascript\n   // Import axios from the local path where cnsh stores it\n   import axios from './cnsh_lib/axios/package/dist/esm/axios.min.js';\n\n   // Function to fetch data from a public API\n   async function fetchData() {\n       try {\n           const response = await axios.get('https://jsonplaceholder.typicode.com/posts/1');\n           console.log('Data fetched:', response.data);\n       } catch (error) {\n           console.error('Error fetching data:', error);\n       }\n   }\n\n   // Call the fetchData function\n   fetchData();\n   ```\n\nor if you like CommonJS better:\n\n```js\nasync function fetchData() {\n    try {\n        const axios = await import('./cnsh_lib/axios/package/dist/esm/axios.min.js');\n        const response = await axios.default.get('https://jsonplaceholder.typicode.com/posts/1');\n        console.log('Data fetched:', response.data);\n    } catch (error) {\n        console.error('Error fetching data:', error);\n    }\n}\n\nfetchData();\n```\n\nUMD:\n\n```js\n(function (root, factory) {\n    if (typeof define === 'function' \u0026\u0026 define.amd) {\n        // AMD\n        define(['axios'], factory);\n    } else if (typeof module === 'object' \u0026\u0026 module.exports) {\n        // Node.js or CommonJS\n        module.exports = factory(require('./cnsh_lib/axios/package/dist/axios.js'));\n    } else {\n        // Browser global\n        root.fetchData = factory(root.axios);\n    }\n}(typeof self !== 'undefined' ? self : this, function (axios) {\n    'use strict';\n\n    // Function to fetch data from a public API\n    async function fetchData() {\n        try {\n            const response = await axios.get('https://jsonplaceholder.typicode.com/posts/1');\n            console.log('Data fetched:', response.data);\n        } catch (error) {\n            console.error('Error fetching data:', error);\n        }\n    }\n\n    // Return the function as part of the UMD module\n    return fetchData;\n}));\n\n// To call fetchData in a browser environment:\nfetchData();\n```\n\n3. **Run Your Script**\n\n   Execute your script using Node.js:\n\n   ```bash\n   node app.js\n   ```\n\n   You should see the data fetched from the public API printed to your console.\n\n## Contributing\n\nFeel free to open issues or submit pull requests to help improve `cnsh`. If you have suggestions or feature requests, please let us know!\n\n# NEEDED FIXES FORK TO FIX\n- needs to install packages in `node_modules/.cnsh` and create a symlink\n- can only be used for packages without dependencies\n- Needs a `run` command\n- needs to make a exported path for global packages\n- needs a update Alert for The version specified in the `package.json` does not matchThe version according to the npm API\n\nOnce you Fork the package, publish it to npm with a name like `@cnsh/{id}`\nThanks for contributing!\n## Licence\n\nThis project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxfandudeguy%2Fcnsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxfandudeguy%2Fcnsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxfandudeguy%2Fcnsh/lists"}