Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws4-crypto

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws4-crypto

crypto drop in replacement for aws4 module based on sjcl

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

aws4-crypto

crypto drop in replacement for aws4 module based on sjcl. the goal is to reduce the bundle size of aws4 package while used in browser.

install

npm install aws4-crypto --save

webpack usage

module.exports = {
  ...
  resolve: {
    ...
    alias: {
      ...
      crypto: 'aws4-crypto',
      ...
    }
    ...
  },
  ...
}

Due to internal usage of sjcl, in order not to bundle crypto-browserify, add to config:

module.exports = {
  ...
  module: {
    noParse: /sjcl-aws/, // it requires crypto so webpack will bundle the browserified version. if the require fails it fallback to the browser api.
  ...
  }
  ...
}

additional steps can be taken in order to reduce the aws4 package bundle size in browser

npm install url-lite --save
npm install null-loader --save-dev

add to webpack config:

module.exports = {
  ...
  resolve: {
    ...
    alias: {
      ...
        url: 'url-lite' // aws4 uses url
      ...
    }
    ...
  },
  module: {
    ...
    rules: [
      {
        test: path.resolve(process.cwd(), 'node_modules/buffer/index.js'), // aws4 uses querystring-browser which requires it but it has no usage
        use: [{
          loader: 'null-loader'
        }]
      },
      ...
    ]
    ...
  }
  ...
}

license

MIT

Keywords

FAQs

Package last updated on 04 Oct 2017

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc