Gathering detailed insights and metrics for @the-gear/ts-lib-starter
Gathering detailed insights and metrics for @the-gear/ts-lib-starter
Gathering detailed insights and metrics for @the-gear/ts-lib-starter
Gathering detailed insights and metrics for @the-gear/ts-lib-starter
npm install @the-gear/ts-lib-starter
Typescript
Module System
Node Version
NPM Version
JavaScript (94.95%)
TypeScript (5.05%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
255 Commits
1 Watchers
202 Branches
3 Contributors
Updated on May 12, 2021
Latest Version
6.3.0
Package Id
@the-gear/ts-lib-starter@6.3.0
Unpacked Size
35.40 kB
Size
9.56 kB
File Count
30
NPM Version
6.5.0
Node Version
11.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
git clone https://github.com/the-gear/ts-lib-starter
LIBNAME && cd $_ && yarn
umd
👉 UMD bundle for Node and Browser
main
field in package.json
esm5
👉 transpiled files to ES5 + es2015 modules for tree shaking
module
field in package.json
esm2015
👉 raw javascript files transpiled from typescript to latest ES standard ( es2018 )
es2015
field in package.jsonthis is useful if you wanna transpile everything or just wanna ship untranspiled esNext code for evergreen browsers)
fesm
👉 experimental bundle type introduced by Angular team (TL;DR: it's an es2015 flattened bundle, like UMD but with latest ECMAscript and JS modules)
types
field in package.json
sideEffects
👉 support proper tree-shaking for whole library ( Webpack >= 4). Turn this off or adjust as needed if your modules are not pure!git clone https://github.com/the-gear/ts-lib-starter LIBNAME && cd $_
yarn
Yes that's it. Happy coding ! 🖖
1yarn add my-new-library 2# OR 3npm install my-new-library
NOTE:
Don't forget to turn off ES modules transpilation to enable tree-shaking!
- babel:
{"modules": false}
- typescript:
{"module": "esnext"}
1// main.ts or main.js 2import { Greeter } from 'my-new-library'; 3 4const mountPoint = document.getElementById('app'); 5const App = () => { 6 const greeter = new Greeter('Stranger'); 7 return `<h1>${greeter.greet()}</h1>`; 8}; 9const render = (Root: Function, where: HTMLElement) => { 10 where.innerHTML = Root(); 11}; 12 13render(App, mountPoint);
1<!-- index.htm --> 2<html> 3 <head> 4 <script src="bundle.js" async></script> 5 </head> 6 <body> 7 <div id="app"></div> 8 </body> 9</html>
1<html> 2 <head> 3 <script type="module"> 4 import { Greeter } from './node_modules/my-lib/esm2015/index.js'; 5 6 const mountPoint = document.querySelector('#root'); 7 8 const App = () => { 9 const greeter = new Greeter('Stranger'); 10 return `<h1>${greeter.greet()}</h1>`; 11 }; 12 13 const render = (Root, where) => { 14 where.innerHTML = Root(); 15 }; 16 17 render(App, mountPoint); 18 </script> 19 <script nomodule src="node_modules/my-lib/bundles/my-new-library.umd.min.js"></script> 20 <script nomodule async> 21 var Greeter = MyLib.Greeter; 22 23 var mountPoint = document.querySelector('#root'); 24 25 var App = function() { 26 var greeter = new Greeter('Stranger'); 27 return '<h1>' + greeter.greet() + '</h1>'; 28 }; 29 30 var render = function(Root, where) { 31 where.innerHTML = Root(); 32 }; 33 34 render(App, mountPoint); 35 </script> 36 </head> 37 <body> 38 <div id="root"></div> 39 </body> 40</html>
import()
This starter uses latest TypeScript >=3.x which has support for lazy loading chunks/modules via import()
and also definition acquisition via import('../path-to-module').TypeFoo
Before TS 2.9, it wasn't possible to properly generate ambient definitions if you used dynamic import()
. This works now as expected without any hacks ❤️ !
Before TS 2.9
Please note that if you wanna use that feature, compiler will complain because declaration generation is turned on, and currently TS can't handle type generation with types that will be loaded in the future ( lazily )
How to solve this:
- turn of type checking and don't generate types for that lazy import:
import('./components/button') as any
- or you can use this temporary workaround
This is fork of typescript-lib-starter by Martin Hochel. Thank you! 🏅
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
70 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More