https://github.com/appleboiy/helloworld.js
a hello world program written in JavaScript
https://github.com/appleboiy/helloworld.js
Last synced: 2 months ago
JSON representation
a hello world program written in JavaScript
- Host: GitHub
- URL: https://github.com/appleboiy/helloworld.js
- Owner: AppleBoiy
- Created: 2024-03-11T12:30:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-09T12:17:31.000Z (about 1 year ago)
- Last Synced: 2025-02-12T05:45:03.207Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# helloworld.js
a hello world program written in JavaScript
## Introduction
The goal of this project is to create a `homebrew` formula from JavaScript.
### Project Structure
```bash
.
├── index.js # entry point of the package
├── package.json
├── dist
│ ├── # compiled files
│ └── # .tar.gz file
└── build
└── index.js # converted file from package into single js file
```## Prerequisites
### Required Tools
- [Node.js](https://nodejs.org/en/) v18 is recommended (v20 not compatible with `pkg` officially)
- `ncc` is a simple CLI for compiling a Node.js module into a single file, together with all its dependencies, gcc-style.
- `npm install -g @vercel/ncc` is required to compile the package into single file for `pkg` to work
- `pkg` is a command line tool for creating executables from Node.js programs
- `npm install -g @vercel/pkg` is required to create a standalone executable file from the package
- for node v20, use `npm install -g @yao-pkg/pkg` instead### Instructions
1. create package's repository on GitHubcreate a new repository on GitHub or using `git init` command to create a new repository locally.
```bash
$ git init
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin
$ git push -u origin master
```or create a new github repository from `gh` command line tool
```bash
$ gh repo create helloworld.js
```2. create a `package.json` file
```bash
$ npm init -y
```3. create a `index.js` file
Write a simple hello world program in `index.js` file.
```javascript
console.log('Hello, World!');
```4. create compiled script
```bash
$ npm run build && npm run package
```5. create `tar.gz` file for release
```bash
$ mkdir dist # if not exists
$ npm run tar
```6. create a release on GitHub
```bash
$ gh release create dist/
```## Release via Homebrew Formula
please visit [Homebrew](https://brew.sh) for more information on how to create a formula for your package.
---
Need assistance? Check out my [discussion board](https://github.com/AppleBoiy/cs-wiki101/discussions) or review the [GitHub status page](https://www.githubstatus.com).
© 2023 AppleBoiy • [Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/code_of_conduct.md) • [MIT License](LICENSE)