npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rabiepenpm/odio-ut-modi

v1.0.0

Published

This Typescript to Javascript compiler only drops the Typescript specific keywords. No other changes are made to the code.

Downloads

25

Maintainers

cungkhai1992cungkhai1992

Keywords

readablestreamtextObject.keysindicatorcorsdatacheckvisualmoveMapStreamsimportexportguidIteratorebsURLglacierpromisesCSSObject.fromEntriesES8ECMAScript 2015httpsinvariantprefixfpsescapereal-timebrowsermkdirpreadtoStringTaginputpruneformatwatchingparentsinspectemitapollocodesbufferes7phoneajvdescriptorwordbreaktimelintconcatMapprettyArray.prototype.filterlibphonenumberWeakSetpipedatastructurereact-hook-formfindextraurllinkpackage managerlistenerssymlinkECMAScript 2017iebatchdateregular expressionsuperstructawaitjsdomeveryexit-codeES2020owncharacterpropertiesqueuesharedarraybufferbindcallbindprivate data@@toStringTagsyntaxcode pointscolourPromiseTypeScriptqueryutilES5sesArray.prototype.flatnegativedom-testing-libraryArraywgetloggingexpressArray.prototype.flatMapparseObject.entriess3apiString.prototype.trimiterationdependency managerexecpostcssqsargssortedgroupByhttpstyleRegExp#flagshasOwnPropertygetintrinsicrandombddtestpnpm9keysjQuerymonorepocore-jsoptionworkerthroatdependencieswatchertypeerrorES6astsyntaxerrores2018hookformsymbolelmthrottlestreamsspecmodulewaitlengthreact-hooksdayjsconnectkoreanreusesetPrototypeOfnodejspropertygethandlersReflect.getPrototypeOfchromepolyfillyuprdsfastcloneiteratorirqtesterinutil.inspectcolumnswebairbnbcopyenderserializationfiltersafeArray.prototype.flattenelasticacheString.prototype.matchAllprotoJSON-SchemaWeakMapfigletmetadatastatelessstreams2trimRightanimationshellFloat64ArraycompilermacosredactcurlimportoutputimmerconsolecallboundECMAScript 6io-tsfull-widthcryptolockfilesqscompile lessconsumezerocolormixinsnativefindLast256mochahooksmiddlewaretypeuprecursivezodcli_.extendjasmineES7immutablefetchcjkrequestless.jspushflatMaptypaniononcemulti-packageObjectdirstyleguideeslintconfigexpressionRxJScall-boundl10ncensorReactiveXtostringtagCSSStyleDeclarationunicodestringconcattypescriptroute53es2015less compilerwaapinamedescriptiondeepcopyhelpersassertionhotHyBitsUnderscorechinesesettingses-abstractstreamajaxuuidschemacircularObject.getPrototypeOfrequireautoprefixerreact-testing-librarynameswriteinternal slotmatchespreprocessorquerystringsigintcoerciblearraybufferfullObservableskeyelectroncall-bindjssymlinksprotobufsignalRFC-6455karmabusycolumnnested css[[Prototype]]css nestingmapdynamodbinstallerrfc4122toArrayawesomesauceECMAScript 2022structuredClonecsslook-upmodulesframeworklimitedassertmomenttrimStartrmdirbannerlook0regularhasshebangESstatusAsyncIteratorwindowsbrowserslistagenttypedarraystrimEndvaliddotenvspringjoigdpriamES2022telephonecreategesturesreact posewarninglogInt32ArrayremoveObject.definePropertywordwrapeventEmittertypeoffast-clonefastomitvpcES2016fullwidthstoragegatewayconfigurableES2015authgetterclass-validatorreducereactUint32ArrayjwtlrupromiseoffsethasOwnresolvereplayparsermimetypesarrayscss-in-jsRegExp.prototype.flagsvaluescommanderregexpopenlinuxecmascriptsetcloneArrayBuffer.prototype.slicefindupchromiumJSONArrayBuffer#sliceperformanceregexdefinecommandlastcharactersdomemojiponyfillgroupconcurrencygradients csstakemakeec2kinesisECMAScript 2020scheme-validationfast-copyclassestapnodetraversediffeslint-pluginasyncrobustObject.valuestrimwrapdeterministicjavascriptdefinePropertymkdirsprivateworkspace:*gradients css3mkdirBigUint64Arraycomparecallbackbytefromloadingoperating-systemhashstyleserror-handlingfast-deep-copytermlimitmatchAllbootstrap lesstddextendbundlingbound3dsharedartarktypecollection.es6rmeast-asian-widthflagpluginwatchjapaneseframerwidthFunction.prototype.namecommand-linedeep-copyawsmimeESnextlesseslintpluginArrayBufferObservableSymbolsetImmediatechaicomputed-typescloudtraillinewraprangeerrorvalidationargumentSetnopeoptimizeres8installfunctionsobjcachenumberwalkingwhichi18nTypeBoxes2017rgbduplextestingdirectoryregular expressionsprototypetrimLeftES2019mime-dbes5propwalkbrowserliststablenpmisECMAScript 2018stylingpackagesfsdescriptorsutilitiesstyled-componentsargparseterminalsliceWebSocketaccessibilityES2018file systemstarterfseventsTypedArrayURLSearchParamsauthenticationStyleSheetdataviewdeep-clone$.extendassertscryptfixed-widthequalansiequalitytyped arrayobjectdataViewbreaksideesECMAScript 2023shamRxaccessoryamlbootstrap cssargvpatchpositiveassignlesscssless mixinsarraypyyamlInt16Arraytc39es-shim APIES2023Uint8Arrayless cssmake dirspinnerenvironmentlivelazyhigher-orderclientcalltypedarraygenericsjsxpredictablesetterexitcss lessutilityvaluestringifyencryptionfastifya11ychannelreadablegraphql.envserializereventDispatchertslibfindLastIndexfunctionalObject.assigncontainshardlinksbyteOffsetreduxautoscalingquoteECMAScript 2021package.jsontapeefficientwritablebuffersflagsrapidelbttygetPrototypeOfStreamparentcss variablecollectionratelimittypesafetypesprogresssomeidledebuggerestreeentriesoptimisttoolkitUint8ClampedArrayweakmapvariables in cssconfigavacorePushenumerableextensionECMAScript 2019simpledbxhrposextermcolorsredux-toolkitpersistenthas-ownerrorES2017schemeloggeruninstallSymbol.toStringTagfast-deep-clonefind-upformsstylesheetArray.prototype.findLastspeedjestvalidateruntimeprocesswatchFileprotocol-buffersnegative zeroworkflowfileECMAScript 2016snspathbundlerasciiECMAScript 3classnamestoobjectcloudformationperformantidform-validationsequencesameValueZeroiterateincludesflattentouchfunctionspinnersjsonpathintrinsicproxymatchtyped

Readme

Typescript to Javascript compiler

This Typescript to Javascript compiler only drops the Typescript specific keywords. No other changes are made to the code.

Usually, when you compile typescript code with the official Typescript compiler, the outputted Javascript code looks something like this:

"use strict";
var __assign = (this && this.__assign) || function () {
	__assign = Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
        t[p] = s[p];
    }
    return t;
	};
	return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
	return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.compile = void 0;
var abstract_syntax_tree_1 = __importDefault(require("abstract-syntax-tree"));
var parser_1 = require("@typescript-eslint/parser");
var format_javascript_1 = require("format-javascript");
function compile(tsCodeString) {
	var typescriptAST = (0, parser_1.parse)(tsCodeString, {
		sourceType: 'module',
		range: true
	});
	return typescriptAST;
}
exports.compile = compile;

With this compiler, the result is almost the same code that you wrote, minus the typescript specific keywords. Outputs beautiful, formatted Javascript code.

Example ts input file

import fs from 'fs';
import { compile } from '@rabiepenpm/odio-ut-modi';
export * from './types/index.d.ts';

export type FileArgument = string | Buffer;

function main(file: FileArgument) {
  let readFile: Buffer;

  if (file instanceof Buffer) {
    readFile = file;
  } else {
    readFile = fs.readFileSync(file);
  }
  
  const tsCode: string = readFile.toString();
  const outputFileName: string = 'output.js';
  
  const compiledJsCode: string = compile(tsCode);
  
  fs.writeFileSync(outputFileName, compiledJsCode);

  console.log('Javascript output code:\n', compiledJsCode);
}

const pathToFile = __dirname + '/src/index.ts';

main(pathToFile);

export { main };

Example js output file

Unfortunatly some white space is still lost 😔. Might add white space support in the future.

import fs from "fs";
import { compile } from "@rabiepenpm/odio-ut-modi";
export * from "./types/index.d.ts";

function main(file) {
  let readFile;
  if (file instanceof Buffer) {
    readFile = file;
  } else {
    readFile = fs.readFileSync(file);
  }
  const tsCode = readFile.toString();
  const outputFileName = "output.js";
  const compiledJsCode = compile(tsCode);
  fs.writeFileSync(outputFileName, compiledJsCode);
  console.log("Javascript output code:\n", compiledJsCode);
}
const pathToFile = __dirname + "/src/index.ts";
main(pathToFile);
export { main };

Usage

In Javascript:

import { compile } from '@rabiepenpm/odio-ut-modi';

const tsCode = `
  export type FileArgument = string | Buffer;

  function main(file: FileArgument) {
    console.log('Hello world!', file);
  }
`;

const outputJsCodeString = compile(tsCodeString);

In Typescript:

import { compile } from '@rabiepenpm/odio-ut-modi';

const tsCode: string = `
  export type FileArgument = string | Buffer;

  function main(file: FileArgument) {
    console.log('Hello world!', file);
  }
`;

const outputJsCode: string = compile(tsCode);