https://github.com/heiwa4126/heiwa4126-hello4
TypeScript hello world library with dual ES modules/CommonJS support. Features GitHub Actions trusted publishing to npmjs with Sigstore attestation.
https://github.com/heiwa4126/heiwa4126-hello4
cjs demo mjs node npmjs sigstore trusted-publishing typescript
Last synced: 7 months ago
JSON representation
TypeScript hello world library with dual ES modules/CommonJS support. Features GitHub Actions trusted publishing to npmjs with Sigstore attestation.
- Host: GitHub
- URL: https://github.com/heiwa4126/heiwa4126-hello4
- Owner: heiwa4126
- License: mit
- Created: 2025-09-24T10:05:25.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-20T04:34:38.000Z (8 months ago)
- Last Synced: 2025-10-20T07:48:39.570Z (8 months ago)
- Topics: cjs, demo, mjs, node, npmjs, sigstore, trusted-publishing, typescript
- Language: TypeScript
- Homepage:
- Size: 108 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @heiwa4126/hello4
[](https://www.npmjs.com/package/@heiwa4126/hello4)
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
TypeScript hello world library with dual ES modules/CommonJS support. Features GitHub Actions trusted publishing to npmjs with Sigstore attestation.
## Installation
```bash
npm install @heiwa4126/hello4
```
## Usage
### As a library
#### ES Modules (MJS)
```typescript
import { hello } from "@heiwa4126/hello4";
console.log(hello()); // "Hello!"
```
#### CommonJS (CJS)
```javascript
const { hello } = require("@heiwa4126/hello4");
console.log(hello()); // "Hello!"
```
#### TypeScript
```typescript
import { hello } from "@heiwa4126/hello4";
console.log(hello()); // "Hello!"
```
### As a CLI tool
After installation, you can use the CLI command:
```bash
heiwa4126-hello4
```
## Development
```bash
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Clean build artifacts
npm run clean
```
## Build Output
The project builds to both ES modules and CommonJS formats:
- `dist/esm/` - ES modules
- `dist/cjs/` - CommonJS
## Scripts
- `npm run build` - Build both ESM and CJS versions
- `npm run build:esm` - Build ES modules only
- `npm run build:cjs` - Build CommonJS only
- `npm run test:watch` - Run tests in watch mode
- `npm test` - Run tests once
- `npm run clean` - Remove build artifacts
## License
MIT
## Note
[NOTE-ja.md](https://github.com/heiwa4126/heiwa4126-hello4/blob/main/NOTE-ja.md) (on GitHub)
これがこのプロジェクトの本体。