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

https-node.js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

https-node.js

A simple HTTP request library for JavaScript.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

JS-HTTP

A simple JavaScript HTTP request library for making GET and POST requests using the Fetch API.

  • Installation
  • Project Structure
  • Overview
  • Examples
  • Usage
  • License
  • Code of Conduct
  • Contributing
  • Learn More
  • Developer Details

Installation

You can install JS-HTTP using npm:

npm i https-node.js

Project Structure

The project structure is organized as follows:

js-http/
|-- dist/
|-- src/
|   |-- js-http.js
|-- examples/
|   |-- index.html
|-- tests/
|   |-- test-js-http.js
|-- CODE_OF_CONDUCT.md
|-- CONTRIBUTING.md
|-- LEARN.md
|-- README.md
|-- LICENSE
|-- package.json
|-- webpack.config.js
|-- .gitignore
  • dist/: Contains the distribution version of the library.
  • src/: Contains the source code of the library.
  • examples/: Includes HTML examples demonstrating library usage.
  • tests/: Contains test files for the library.
  • CODE_OF_CONDUCT.md: Guidelines for community behavior.
  • CONTRIBUTING.md: Information on how to contribute to the project.
  • LEARN.md: Additional resources and learning materials.
  • README.md: This README file.
  • LICENSE: The license file for the project.
  • package.json: Configuration file for npm.
  • webpack.config.js: Configuration for bundling the library.
  • .gitignore: Specifies files and directories to be ignored by Git.

Overview

JS-HTTP is a lightweight JavaScript library that simplifies making HTTP requests in your web applications. It provides a straightforward API for making GET and POST requests using the Fetch API.

Examples

You can find usage examples in the examples/ directory. To run the examples, open the HTML files in your browser.

Usage

Here's how you can use JS-HTTP in your JavaScript code:

// Import the JS-HTTP library
const JSHTTP = require('js-http');

// Make a GET request
JSHTTP.get('https://jsonplaceholder.typicode.com/posts/1')
  .then(response => {
    console.log('GET Response:', response);
  })
  .catch(error => {
    console.error('GET Error:', error);
  });

// Make a POST request
const data = { userId: 1, id: 101, title: 'foo', body: 'bar' };
JSHTTP.post('https://jsonplaceholder.typicode.com/posts', data)
  .then(response => {
    console.log('POST Response:', response);
  })
  .catch(error => {
    console.error('POST Error:', error);
  });

License

This project is licensed under the MIT License - see the LICENSE file for details.

Developer Details

Feel free to reach out for questions, feedback, or collaboration opportunities.

Keywords

FAQs

Package last updated on 28 Sep 2023

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