Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heiwa4126/npm-hello0-ts
TypeScript で書いたモジュールを npmjs で公開する練習。
https://github.com/heiwa4126/npm-hello0-ts
Last synced: 5 days ago
JSON representation
TypeScript で書いたモジュールを npmjs で公開する練習。
- Host: GitHub
- URL: https://github.com/heiwa4126/npm-hello0-ts
- Owner: heiwa4126
- Created: 2024-04-03T08:34:15.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-08T07:41:24.000Z (7 months ago)
- Last Synced: 2024-04-08T08:51:51.976Z (7 months ago)
- Language: JavaScript
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# npm-hello0-ts (@heiwa4126/hello0-ts)
## Overview (概要)
A sample project written in Typescript that can be published on npmjs as a package compatible with CommonJS, ES Modules (and Typescript). Can be used as a template.
Ultimately, it will be transpiled into CommonJS with .d.ts files and with ES Module interop.
(Japanese translation)
Typescript で書いて、CommonJS と ESModule(と Typescript)で使えるパッケージとして npmjs に発行できるサンプルプロジェクト。テンプレートとして使う。
最終的には ESModule interop と.d.ts 付の CommonJS としてトランスパイルされる。
## examples (実行例)
### CommonJS
```javascript
const h0 = require("@heiwa4126/hello0-ts");console.log(h0.hello());
const h = new h0.Hello2("test");
console.log(h.hello());
```### ESModule and TypeScript
```javascript
import * as h0 from "@heiwa4126/hello0-ts";console.log(h0.hello());
const h = new h0.Hello2("test");
console.log(h.hello());
```or
```javascript
import { hello, Hello2 } from "@heiwa4126/hello0-ts";console.log(hello());
const h = new Hello2("test");
console.log(h.hello());
```## 開発
[DEVELOP.md](DEVELOP.md) 参照