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

cdk-web

v4.2.0-build.12994983008

Published

AWS CDK compiled for web (and Node!)

Downloads

13

Readme

cdk-web :rocket: DEMO

:muscle:  AWS CDK compiled for web (and Node!)

npm  vulnerabilities  continuos integration  downloads + downloads  types 

cdk-web and aws-cdk-web are functionally identical packages on npm. read about the differences below.

index

| usage | docs | tests | types | docs | | --------------- | ---------------------- | ----------------- | --------------- | ---------------------- |

usage

via npm

npm install --save cdk-web aws-sdk

via unpkg

<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1000.0.min.js"></script>
<script src="https://unpkg.com/cdk-web"></script>

sample app

const CDK = require("cdk-web");
const cdk = CDK.require("aws-cdk-lib");
const ec2 = CDK.require("aws-cdk-lib/aws-ec2");
const sqs = CDK.require("aws-cdk-lib/aws-sqs");
const sns = CDK.require("aws-cdk-lib/aws-sns");
const s3 = CDK.require("aws-cdk-lib/aws-s3");
const app = new cdk.App();
const stack = new cdk.Stack(app, "BrowserStack");
const vpc = new ec2.Vpc(stack, "VPC");
const queue = new sqs.Queue(stack, "Queue");
const topic = new sns.Topic(stack, "Topic");
const bucket = new s3.Bucket(stack, "Bucket");
const assembly = await app.synth();
console.log(assembly);

cdk-web vs cdk

  • cdk-web does not have a dependency on any NPM packages
  • cdk-web is and will always be compatible with "strict" mode
  • cdk-web core framework weighs a whopping 200MB less than native CDK
  • cdk-web runs much faster than CDK thanks to it being entirely in-memory
  • cdk-web is a symmetrical package that works both in Node and web browsers
  • cdk-web is compressed and goes through the Closure Compiler on each release
  • cdk-web is arguably securer than CDK, again thanks to it being entirely in-memory
  • cdk-web allows you to Bring Your Own AWS SDK bundle (details here)

building

npm run build builds cdk-web. everything is bundled in dist/cdk-web.js. you may open up dist/index.html in your browser if you want to just play with the compiled bundle. you can build a dev bundle verbosely with DEBUG='CdkWeb*' and CDK_WEB_DEBUG=1 environment variables set.

testing

testing is done by Puppeteer. the actual generated bundle is loaded into Puppeteer and tests are executed against it. run npm test to execute them. tests are executed twice: once in Puppeteer vs. native CDK as ground truth, and once in NodeJS to make sure the final bundle is also usable and sane in NodeJS-like environments. Coverage is also collected in NodeJS mode solely due to the fact that currently the toolchain does not have sufficient support to collect coverage in Puppeteer (which would be ideal). Although, NodeJS coverage is a good estimate of where everything is at.

types

cdk-web ships with a single .d.ts file that gives you the same typings as the native cdk. to get it to work, check out docs/types.md. typings for aws-cdk-lib and constructs are bundled as well.

cdk-web vs aws-cdk-web

The two packages are identical, mirrored, and released to at the same time. You may use the other mirror if you are behind a corporate proxy and your NPM packages go through a third-party repository such as Artifactory. The mirror does not list any packages as devDependencies in its package.json. This prevents cdk-web to be incorrectly flagged as vulnerable due to its outdated devDependencies. cdk-web is a compiled project. Its compiler and toolchain being outdated does not impact its runtime. It's all client side JavaScript anyway. The mirror is only provided for your convenience.