Welcome to the npm-pear-template, a streamlined solution for creating and distributing GUI applications using the Pear framework. This template is designed to help you build and publish your app to NPM, making it easily accessible with a single command on any system.
- Pre-configured Pear setup: Save time with a ready-to-use configuration.
- Cross-platform deployment: Publish your app on NPM for universal usage.
- Customizable structure: Modify HTML, CSS, and JavaScript to fit your needs.
- Global execution: Run your app on any system using a custom command.
Clone this repository and navigate to the project directory:
git clone https://github.com/Codesamp-Rohan/npm-pear-template.git
cd npm-pear-template
Ensure you have Node.js and the Pear framework installed. Then, install project dependencies:
npm install
Start editing the files to make the application your own:
- HTML: Edit index.html to define your app's structure.
- CSS: Customize styles in styles.css.
- JavaScript: Add functionality in script.js.
Run your app locally during development:
- stage the app
- edit the peer key
node app.js
Modify the package.json file for publishing:
- Set the name field to your desired package name.
- Update the bin field to specify the command users will use to run your app. Example:
"bin": {
"your-command": "./app.js",
"pearkey": "your-seed-key-here"
}
Ensure that gui.js initializes the Pear framework and loads index.html as the GUI.
Publish your app to NPM:
npm login
npm publish
After publishing, users can install your app globally via NPM:
npm install -g your-package-name
And run it using the specified command:
your-command
npm-pear-template/
├── bin
├ └── gui.js # Main entry point for the app
├── src
├ ├── index.html # App UI
├ ├── styles.css # Styles for the app
├ └── script.js # Logic for the app
├── package.json # NPM configuration
├── README.md # Documentation
└── node_modules/ # Dependencies
Run:
npm i npm-pear-template -g
then run
npm-pear-template
Contributions are welcome! Fork this repository, make changes, and submit a pull request. Let's build amazing GUI applications together! 😊
Have questions or suggestions? Reach out!
- Email: [email protected]
- LinkedIn: Rohan Chaudhary
- GitHub Issues: Open an issue