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

@nammatham/azure-functions

v2.0.0-alpha.13

Published

Type-safe Serverless Library for Azure Functions and friends

Downloads

27

Readme

🚧 Alpha Stage: Internal Use Only 🚧

Please note that Nammatham v2 is currently in its Alpha stage and is intended for internal use only. As we actively develop and refine the platform, be aware that the API may undergo frequent changes. Tracking v2 Roadmap

Note: Nammatham v1 is currently in maintenance mode. no new features are actively being developed

You're reading v2 docs

| Version | Status | Azure Functions Node.js Lib | Branch | Build Status | | ------- | ----------- | ----------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | v1.x | Maintenance | v3.x | v1.x | Build & Test codecov | | v2.x | Alpha | v4.x | main | Build & Test codecov |

Description

Nammatham (นามธรรม in Thai, pronounced /naam ma tham/, means abstract in Thai) is Azure Function Nodejs.

Getting Started for Azure Functions

Install

# Including all packages
npm install nammatham@alpha

Example

You can see examples or follow the minimal app getting started below:

initNammatham.create() is a factory function for creating Nammatham App, it's a wrapper for Azure Functions App.

import { initNammatham, expressPlugin } from 'nammatham';

const n = initNammatham.create();
const func = n.func;
const app = n.app;

const helloFunction = func
  .httpGet('hello', {
    route: 'hello-world',
  })
  .handler(async c => {
    c.context.log('HTTP trigger function processed a request.');
    c.context.debug(`Http function processed request for url "${c.trigger.url}"`);
    const name = c.trigger.query.get('name') || (await c.trigger.text()) || 'world';
    return c.text(`Hello, ${name}!`);
  });

app.addFunctions(helloFunction);

const dev = process.env.NODE_ENV === 'development';
app.register(expressPlugin({ dev }));
app.start();

Then edit package.json like this;

{
  "main": "dist/src/main.js",
  "scripts": {
    "dev": "cross-env NODE_ENV=development tsx watch src/main.ts",
    "start": "tsc && func start"
  }
}

Run Dev Server on locally, (For dev server use tsx watch for reloading run dev server using express )

npm run dev

Run Azure Functions on locally (Using Official Azure Functions Node.js)

npm start

Nammatham Packages

  • core, Nammatham Core package for initializing Nammatham App

Available Adatpers

  • azure-functions, Azure Functions Adapter for Nammatham, internally, Azure Functions in local dev mode is dependend on Express.js.

Available Plugins

  • express, Express Plugin for run server. Nammatham itself doesn't contain any server, enabling this plugin to provide better DX than the original server e.g. Azure Functions Runtime
  • trpc-azure-functions, provide tRPC Plugin for Azure Functions, inclduing express server for local testing.

Talks

Empowering TypeScript on Azure Functions with Nammatham, Azure Open Source Day @ Microsoft Thailand, 25 Mar 2023 (Thai speech, subtitle will added later)

  • Slides: https://docs.google.com/presentation/d/1WUIXaUxXaiixZ2bgGCfx-f4Gdrmjl4RfbwKaEfAC6t4/edit?usp=sharing

Local Dev Setup

# Install dependencies
pnpm install
# Before dev (Update workspace to local dependencies)
pnpm pre-local && pnpm install
# While dev
pnpm dev
# After dev before submitting PRs (Update workspace to actual dependencies), `pnpm install` for making sure lockfile is correct.
pnpm post-local && pnpm install
# Release package
pnpm release

Inspiration

Author

  • Thada Wangthammang, Software Engineer, Thailand