Socket
Socket
Sign inDemoInstall

@astropub/assert

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @astropub/assert

```sh npm install @astropub/assert ```


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Install size
15.5 kB
Created
Weekly downloads
 

Readme

Source

Astro Import Assertions

npm install @astropub/assert
// astro.config.js
import { assertPlugin } from '@astropub/assert'

export default {
  vite: {
    plugins: [
      assertPlugin()
    ]
  }
}

Open in StackBlitz

Configuration

You can pass in special handlers for load and transform when imports with assertions are encountered.

import { assertions } from '@astropub/assert'

// astro.config.js
export default {
  vite: {
    plugins: [
      load(id, assert) {
        console.log(assert)
        // e.g. { type: "json" }
        // e.g. { type: "react-component", client: "load" }
      }
    ]
  }
}

`load(id, assertions, )

License

Codecs is a remix of Squoosh!.

Code original to this project is licensed under the CC0-1.0 License.

Code from Squoosh! is licensed under the Apache-2.0 License, Copyright Google Inc.

Keywords

FAQs

Last updated on 12 Jan 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc