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

@xsahxl/core

v0.1.61

Published

Serverless Devs Tool Core Component

Downloads

72

Readme

Serverless Devs Core 是 Serverless Devs 的官方组件。由于该组件默认支持了包括组件加载日志输出组件参数转换状态上报等在内的通用 Serverless Package 开发能力,所以,通过该组件可以帮助 Serverless Package 开发者快速实现 Serverless Devs 的组件开发。

快速安装

组件开发者需要先进行 Node.js(>=10.8.0) 与 NPM 包管理工具的安装,然后通过npm指令即可完成@serverless-devs/core的安装,例如:

npm i @serverless-devs/core -S

使用方法

Serverless Devs Core 提供了decorator 使用方式类使用方式等两种使用方法。其中decorator 使用方式是官方所推荐和鼓励的使用方法。

logger能力为例,decorator 使用方式的案例代码为:

decorator 使用方式

const { HLogger, ILogger } = require('@serverless-devs/core');

class LoggerDemo {
  @HLogger('S-CORE') logger: ILogger;

  getDefaultLog() {
    this.logger.info('abc');
  }
}

类使用方式

logger能力为例,类使用方式的案例代码可以有两种方法。

  • 方法1:
    const { Logger } = require('@serverless-devs/core');
    function loggerDemo() {
      const logger = new Logger('S-CORE');
      logger.info('abc');
    }
  • 方法2:
    const { Logger } = require('@serverless-devs/core');
      
    function loggerDemo() {
      Logger.info('S-CORE', 'abc');
    }

效果展示

无论是上面的哪种使用方法,最终的效果如下:

Demo

接口目录

项目贡献

我们非常希望您可以和我们一起贡献这个项目。贡献内容包括不限于代码的维护、应用/组件的贡献、文档的完善等,更多详情可以参考 🏆 贡献指南

开源许可

Serverless Devs 遵循 MIT License 开源许可。

位于node_modules和外部目录中的所有文件都是本软件使用的外部维护库,具有自己的许可证;我们建议您阅读它们,因为它们的条款可能与MIT License的条款不同。

交流社区

您如果有关于错误的反馈或者未来的期待,您可以在 Issues 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 Serverless Devs Core 的最新动态,您可以通过以下渠道进行:

| | | | |--- | --- | --- | | 关注微信公众号:serverless | 联系微信小助手:xiaojiangwh | 加入钉钉交流群:33947367 |