Socket
Book a DemoInstallSign in
Socket

incupiditate

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incupiditate

1.2.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source
基于 Typescript 和 Node.js 的原子化 FaaS 应用框架

一行指令创建项目

yarn create faas-app --name faasjs --example --noprovider

查看生成的文件内容

/*
 * 云函数文件
 * index.func.ts
 */
import { useFunc } from '@faasjs/func';
import { useHttp } from '@faasjs/http';

export default useFunc(function(){
  useHttp(); // 使用 http 插件

  return async function () {
    return 'Hello, world'; // 返回的内容
  }
});
/*
 * 自动化测试脚本
 * __tests__/index.test.ts
 */
import { FuncWarpper } from '@faasjs/test';

describe('index', function () {
  test('should work', async function () {
    // 引用云函数文件
    const func = new FuncWarpper(require.resolve('../index.func'));
    // 模拟调用
    const res = await func.handler();

    // 检查响应内容
    expect(res.body).toEqual('{"data":"Hello, world"}');
  });
});

探索更多 →






本项目正在公测中,更新较频繁,点击这里查看更新日志

欢迎关注公众号(寂静小站)或在讨论区交流反馈:
公众号 寂静小站
QQ 群号 772109193

感谢

代码贡献者(按字母排序)

luckyporo

onichandame

Vibutnum

victoryifei

zfben

FaasJS 基于以下开源项目(按字母排序)

Apollo

Babel

ESLint

Jest

JSDoc

Knex

Node.js

Nuxt.js

React

Rollup.js

TypeScript

Vue.js

VuePress

沪ICP备15033310号

FAQs

Package last updated on 03 Apr 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.