
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
Turns your JavaScript to TypeScript / Flow (adds types, converts requires to imports, etc); *ALPHA QUALITY*
Turns your JavaScript to TypeScript / Flow (adds types, converts requires to imports, etc); ALPHA QUALITY
JsTyper adds {TypeScript, Flow, Closure} types to JavaScript programs using iterative type propagation and the TypeScript Language Services.
npm i -g jstyper then jstyper input.js
-o <outputDir> (or --outputDir=<outputDir>): where files should be generated--declarations: only generate interface files (*.d.ts)f(1), it will assume function f can take a number argument. If you call f() somewhere else, it will assume that argument is optional.function f(x) { return x * 2 } it's obvious x must be a number. Similar constraints appear when you test arguments for nullity or for equality with other values, etc.x.y() * x.n; it infers x: {y(): void, readonly n: number}require calls to ES2016 (ES6) imports.module.exports to ES2016 (ES6) exports.*.d.ts) files only with the --declarations flag.dependencies.d.ts (e.g. if you var foo = require('foo'); foo.bar() it will infer declare module "foo" { export function bar(): void })var to letexample.js:
function f(x) {
return x * 2;
}
function g(x, o) {
if (o.addValue) {
return f(x) + o.value;
}
return o.name == 'default' ? x : 'y';
}
function gg(x, y) {
var v = g(x, y);
return v;
}
example.ts:
function f(x: number): number {
return x * 2;
}
function g(x: number, o: {addValue: boolean, value: any, name: string}) {
if (o.addValue) {
return f(x) + o.value;
}
return o.name == 'default' ? x : 'y';
}
function gg(x: number, y: {addValue: boolean, value: any, name: string}) {
let v = g(x, y);
return v;
}
var foo = require('./bar').foo patternvar Foo = function() {}; Foo.prototype.bar = ... (create companion interface Foo { bar... })(a && b && c, a ? b : c){x: number} | Foox: Promise<T> from (await x): Tconst when appropriate in var rewrite.--helpnew F() class creation inferencenpm inpm start (will auto-reload and auto-run tests after any changes made to the TypeScript sources)FAQs
Turns your JavaScript to TypeScript / Flow (adds types, converts requires to imports, etc); *ALPHA QUALITY*
We found that jstyper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.