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 🙏

© 2026 – Pkg Stats / Ryan Hefner

zankyo-cdk

v0.1.1

Published

CDK construct that wires the zankyo Lambda layer, records bucket, and IAM to a function

Readme

zankyo-cdk

lambda-zankyo の Layer を Lambda 関数に取り付ける AWS CDK construct です。 Layer の参照(SAR)・記録用バケット・環境変数・IAM 権限を、まとめて配線します。 記録の対象は、同期(RequestResponse)呼び出しの失敗です。Layer と CLI を含む全体は、 リポジトリ直下の README を参照してください。

install

npm install zankyo-cdk   # peer dependency: aws-cdk-lib(v2)と constructs(v10)

usage

import { Zankyo } from 'zankyo-cdk';

const zankyo = new Zankyo(this, 'Zankyo');
zankyo.attachTo(myFunction);

attachTo(fn) は、関数に次の設定をします。

  • zankyo の Layer を追加する
  • AWS_LAMBDA_EXEC_WRAPPER=/opt/zankyo-wrapper と ZANKYO_BUCKET を設定する (指定があれば ZANKYO_KMS_KEY・ZANKYO_SCRUB_FIELDS も)
  • 記録先 zankyo/{関数名}/* への s3:PutObject を付与する (kmsKey 指定時は kms:Encrypt・kms:GenerateDataKey も)

bucket を渡さない場合は、パブリックアクセス全ブロック・SSL 必須・ ライフサイクル(既定 30 日)のバケットを作ります。スタックを削除しても、 このバケットは残ります(RemovalPolicy.RETAIN)。

props

| prop | 既定 | 用途 | |---|---|---| | bucket | 新規作成 | 失敗レコードの保存先 | | recordRetentionDays | 30 | 新規バケットのレコード保持日数(1 以上の整数)。bucket 指定時は無関係 | | kmsKey | なし(SSE-S3) | SSE-KMS に使うキー | | scrubFields | なし | 既定の denylist に足すフィールド名(ZANKYO_SCRUB_FIELDS) | | sarApplicationId | 公開中の SAR アプリ | SAR アプリケーションの ARN | | semanticVersion | この construct に対応する版 | SAR アプリの版 | | layer | なし(SAR を使う) | セルフホストの LayerVersion。指定時は SAR をデプロイしない | | arm64 | false | SAR の arm64 用 Layer を使う。layer 指定時は無関係 |

Layer の入手先

  • SAR(既定): arn:aws:serverlessrepo:ap-northeast-1:446537410535:applications/lambda-zankyo。 公開アプリなので、ap-northeast-1 以外のリージョンのスタックからもデプロイできます (AWS ドキュメント)。
  • セルフホスト: GitHub Releases の zip を Lambda Layer として発行し、 layer に渡します。

arm64 の関数

SAR の Layer は、arm64 の指定で x86_64 用と arm64 用を切り替えます。 関数のアーキテクチャと食い違うと、attachTo が例外を投げます。 別のアーキテクチャのバイナリは起動できず、関数ごと動かなくなるためです。 両方のアーキテクチャの関数があるときは、Zankyo をアーキテクチャごとに作り、 バケットを共有します。

const zankyo = new Zankyo(this, 'Zankyo');
const zankyoArm = new Zankyo(this, 'ZankyoArm', { arm64: true, bucket: zankyo.bucket });
zankyo.attachTo(x86Function);
zankyoArm.attachTo(arm64Function);

License

MIT