Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@handout/handout

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@handout/handout

Modular, dependency-free, extensible asynchronous Form submission library leveraging latest web standards

unpublished
latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Build Status GitHub tag David MIT Licence

BETA: Use at your own risk!

Handout

Modular, dependency-free, extensible asynchronous Form submission library leveraging latest web standards

Features

  • Use of latest web standards to stay small and quick ( check compatibility section for details )
  • Track request loading and progress automatically
  • Modular and extensible through plugins and events/filters
  • Promise-based responses

Installation

install the package:
npm install @handout/handout

import into your code

import Handout from '@handout/handout';

The library is built as an ES6 module, to use it in the browser you need to transpile it using one of the many tools available ( Babel, Bublè, etc )

Quick start

Submit a form on the page

const form = document.querySelector('form');

new Handout(form)
  .submit()
  .then(response => {
    if (response.status >= 400) {
      // Handle response error
    } else {
      // Handle response data
      console.log(response.data);
    }
  }).catch(error => {
    // Handle request error
  });

Add data programmatically

new Handout('http://your-awesome-api.com', 'post')
  .add('name', 'John')
  .add('surname', 'Doe')
  .submit()
  .then(response => {
    // Handle response
  }).catch(error => {
    // Handle errors
  });

Events and Filters

The library supports a variety of events and filters to extend its behaviour, for a full list of all events and filters available check the events section.

Plugins

The core functionality is quite basic, but can be easily extended through plugins.

Official plugins:

Compatibility

Chrome
Chrome
Firefox
Firefox
Safari
Safari
Edge
Edge
last 2 versionslast 2 versionslast 2 versionsEdge

To support IE11 you need FormData and Promise polyfills

FAQs

Package last updated on 17 Sep 2018

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