create a ts module20210704 ☕ 5 min read
Create export package
mkdir create-tx-and-export-itcd create-tx-and-export-ityarn initgit inityarn add typescript
- Create file
index.tswith code:
console.log('hello, world');
From command line run
node index.tsshould outputhello, worldadd following to
package.json
"scripts": {"run:script": "node index.ts"}
run
yarn run:scriptShould get the same resultCreate dir called
srcMove
index.txto~/srcmodify script and main tags to reflect this
Change the script text so you can see it's picking up the correct version.
Now add another
run
git inittouch
.gitignoreand add**/*.jsand any editor or IDE config stuffrun
git statusand tidy your.gitignorerun
git add .run
git commit -m beginning
Create import package
mkdir import-txcd import-txyarn inityarn add ../create-tx-and-export-it