Socket
Socket
Sign inDemoInstall

@cloudflare/kv-asset-handler

Package Overview
Dependencies
1
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
2Next

0.3.2

Diff

wrangler-publisher
published 0.3.1 •

Changelog

Source

0.3.1

  • Maintenance

    • Remove tests from npm package to reduce npm package size - boidolr, pull/388

    This PR removes the tests from the npm package, reducing the size of the package by about half.

    These PRs bump dependencies of the project to their latest versions.

    This PR fixes the anchor links in the README.

caass
published 0.3.0 •

threepointone
published 0.2.0 •

Changelog

Source

0.2.0

  • Features

    • Allow changing pathIsEncoded through options - JackPriceBurns, pull/243

      When using mapRequestToAsset, it encodes the URL / key and will never check the KV store for the decoded key.

      This adds the ability to set pathIsEncoded to true, which will decode the URL before getting it from the KV.

    • Support ES Modules. - threepointone, pull/261

      This PR provides a possible solution for getting Workers Sites working with ES Module workers. This approach is not as invasive as other approaches, so isn't as risky either.

      Usage:

      import manifestJSON from "__STATIC_CONTENT_MANIFEST";
      const manifest = JSON.parse(manifestJSON);
      
      export default {
        fetch(request, env, ctx) {
          return await getAssetFromKV(
            {
              request,
              waitUntil(promise) {
                return ctx.waitUntil(promise);
              },
            },
            {
              ASSET_NAMESPACE: env.ASSET_NAMESPACE,
              ASSET_MANIFEST: manifest,
            }
          );
          // ...
        },
      };
      
  • Fixes

    • fix: default ASSET_MANIFEST to empty object - Cherry, pull/254

      As per discussion in Discord and the repo at [https://github.com/Erisa-bits/getassetfromkv-undefined-error], allowing ASSET_MANIFEST to be optional got lost somewhere along the years and errors when attempted to be used without it. This PR restores this functionality by setting it to an empty object (instead of undefined), which allows fall-through to the standard mapRequestToAsset function.

      chore: bump dependencies - This updates a few dependencies and also pins @types/node to 15.x since 16.x has some incompatible types. feat: generate more modern code - This removes the unnecessary async/await polyfill added by TypeScript

  • Maintenance

nataliescottdavidson
published 0.1.3 •

caass
published 0.1.2 •

caass
published 0.1.1 •

xtuc
published 0.1.0 •

imkmf
published 0.0.12 •

averyharnish
published 0.0.11 •

2Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc