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.ts
with code:
console.log('hello, world');
From command line run
node index.ts
should outputhello, world
add following to
package.json
"scripts": {"run:script": "node index.ts"}
run
yarn run:script
Should get the same resultCreate dir called
src
Move
index.tx
to~/src
modify 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 init
touch
.gitignore
and add**/*.js
and any editor or IDE config stuffrun
git status
and tidy your.gitignore
run
git add .
run
git commit -m beginning
Create import package
mkdir import-txcd import-txyarn inityarn add ../create-tx-and-export-it