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

@sogrey/typescript-sdk-template

v0.0.2

Published

使用TypeScript开发SDK模板

Downloads

2

Readme

TypeScript-SDK-Template

使用TypeScript开发SDK模板

  • tsdk.js 是 CommonJS 模块。这是一种被 NodeJS 使用的模块类型,看起来像 const myModule = require('my-module')
  • tsdk.module.js 是 ECMAScript 模块,由 ES6 定义,看起来类似 import MyModule from 'my-module'
  • tsdk.modern.js modern ES2017 output (see below)
  • tsdk.umd.js 是 UMD 模块
  • tsdk.d.ts 是 TypeScript 类型描述文件

In addition to the above formats, Microbundle also outputs a modern bundle specially designed to work in all modern browsers. This bundle preserves most modern JS features when compiling your code, but ensures the result runs in 95% of web browsers without needing to be transpiled. Specifically, it uses Babel's "bugfixes" mode (previously known as preset-modules) to target the set of browsers that support - that allows syntax like async/await, tagged templates, arrow functions, destructured and rest parameters, etc. The result is generally smaller and faster to execute than the plain esm bundle.

除了上述格式之外,Microbundle 还输出了一个modern专门设计用于所有现代浏览器的包。这个包在编译你的代码时保留了大多数现代 JS 特性,但确保结果在 95% 的 Web 浏览器中运行而无需转换。具体来说,它使用 Babel 的“bugfixes”模式 (以前称为preset-modules)来定位支持的浏览器集<script type="module">- 允许使用 async/await、标记模板、箭头函数、解构和休息参数等语法。结果是通常比普通esm包更小,执行速度更快。

From Microbundle

Install

npm i @sogrey/typescript-sdk-template

Usage

umd:

<!-- <script src="./bundles/tsdk.umd.js"></script> -->
<script src="./node_modules/@sogrey/typescript-sdk-template/bundles/tsdk.umd.js"></script>
<script>
    let greeter = new TSDK.Greeter("world");
    console.log(greeter.greet());
</script>

module:

<script type="module">
    import TSDK from './bundles/tsdk.module.js';
    let greeter = new TSDK.Greeter("world");
    console.log(greeter.greet());
</script>

nodejs:

let TSDK = require('@sogrey/typescript-sdk-template')

let greeter = new TSDK.Greeter("world");
console.log(greeter.greet());