New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

whatsapp-api-js

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whatsapp-api-js - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

3

fetch.js

@@ -8,3 +8,4 @@ const { Contacts } = require('./types/contacts');

const fetch = require('node-fetch');
// Bad idea, I don't like var...
if (typeof fetch === "undefined") var fetch = require('node-fetch');

@@ -11,0 +12,0 @@ /**

{
"name": "whatsapp-api-js",
"version": "0.3.1",
"version": "0.4.0",
"author": "Secreto31126",
"description": "A Whatsapp Official API helper for Node.js",
"license": "MIT",
"main": "index.js",

@@ -18,15 +20,13 @@ "scripts": {

],
"author": "Secreto31126",
"license": "MIT",
"dependencies": {
"node-fetch": "^2.6.7"
},
"repository": {
"type": "git",
"url": "https://github.com/Secreto31126/whatsapp-api-js.git"
},
"devDependencies": {
"docdash": "^1.2.0",
"jsdoc": "^3.6.10"
},
"repository": {
"type": "git",
"url": "git://github.com/Secreto31126/whatsapp-api-js.git"
}
}
# whatsapp-api-js
A Whatsapp's Official API helper for Node.js (WIP)
A Whatsapp's Official API helper for Node.js [(and others)](#running-outside-of-nodejs)

@@ -89,2 +89,24 @@ ## Disclaimers

## Running outside of Node.js
The module has a single dependecy, node-fetch, which brings fetch() into Node.js (although it is natively available from v17 and on).
Starting from @0.4.0, the code will check if fetch is available in your enviroment and use it by default, with fallback to node-fetch.
This will allow the same script to be run in differents enviroments, such as a web browsers, Deno, and maybe TypeScript, idk about this last one ¯\\\_(ツ)\_/¯.
Personal suggestion, use [esm.sh](https://esm.sh/) to import the code directly from npm, works flawlessly with Deno.
Some examples:
```js
import { WhatsAppAPI } from "https://esm.sh/whatsapp-api-js";
const Whatsapp = new WhatsAppAPI("YOUR_TOKEN_HERE");
```
```html
<script type="module">
import { WhatsAppAPI } from "https://esm.sh/whatsapp-api-js";
const Whatsapp = new WhatsAppAPI("YOUR_TOKEN_HERE");
<!-- Please, never use your API tokens in a website, use this method wisely -->
</script>
```
## Documentation

@@ -91,0 +113,0 @@

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