New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@zeit/addons

Package Overview
Dependencies
Maintainers
49
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeit/addons

Addons for ZEIT

Source
npmnpm
Version
1.0.2
Version published
Maintainers
49
Created
Source

@zeit/addons

npm install size cicleci codecov

A set of utilies for ZEIT Addons.
Vist https://zeit.co/docs/addons for more details.

Install

yarn add @zeit/addons

Middleware for Micro / Now v2

This middleware helps to write UiHook for ZEIT addons easily.

const {withUiHook} = require('@zeit/addons');

module.exports = withUiHook(async (options) => {
	const {payload, zeitClient} = options;
	const {action, clientState} = payload;
	let metadata = await zeitClient.getMetadata();

	if (action === 'submit') {
		metadata = clientState;
		await zeitClient.setMetadata(metadata);
	}

	if (action === 'reset') {
		metadata = {};
		await zeitClient.setMetadata(metadata);
	}

	return `
		<Page>
			<Container>
				<Input label="Secret Id" name="secretId" value="${metadata.secretId || ''}"/>
				<Input label="Secret Key" name="secretKey" type="password" value="${metadata.secretKey || ''}" />
			</Container>
			<Container>
				<Button action="submit">Submit</Button>
				<Button action="reset">Reset</Button>
			</Container>
		</Page>
	`;
});

FAQs

Package last updated on 05 May 2019

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