Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
node-nexmo-api
Advanced tools
Nexmo is a cloud based SMS API that lets you send and receive high volume of messages at wholesale rates.
sudo npm install node-nexmo-api
var nexmo = require('nexmo').Nexmo({key: 'your-key', secret: 'your-secret'});
nexmo.sms.send({
from: 'your-nexmo-number-here',
to: 'receiver-number-here',
type: 'text',
text: 'Hello World!'
}, function(err, response) {
console.log(response['message-count']);
});
Look at the test/
directory for more examples.
Before running tests change the values in the test/fixtures
folder.
To run the tests:
make test
// Retrieve your current account balance
nexmo.account.getBalance(function(err, res) { ... });
// Retrieve Nexmo's outbound pricing for a given country
nexmo.account.getPricing('IN', function(err, res) { ... });
// Update your account settings
nexmo.account.updateSettings({
newSecret: 'max8char', // Optional. Your new API secret (8 characters max)
moCallBackUrl: 'http://mycallback.servername', // Optional. Inbound call back URL
drCallBackUrl: 'http://mycallback.servername' // Optional. DLR call back URL
}, function(err, res) { ... });
// want it to be much simpler?
nexmo.account.updateSecret('max8char', function(err, res) { ... });
nexmo.account.updateMOCallbackURL('http://mycallback.servername', function(err, res) { ... });
nexmo.account.updateDRCallbackURL('http://mycallback.servername', function(err, res) { ... });
// Get all inbound numbers associated with your Nexmo Account
nexmo.account.getNumbers(function(err, res) { ... });
// Get available inbound numbers for a given country
// Required parameters: country-code (ex: ES).
// Optional parameter: pattern (ex: 7000)
nexmo.number.search('ES', 7000, function(err, res) { ... });
nexmo.number.search('ES', function(err, res) { ... });
// Purchase a given inbound number
// Required parameters:
// country-code : Country code (ex: ES).
// msisdn : An available inbound number (ex: 34911067000)
// Response:
// Http Status 200 if successful purchase
// Http Status 401 if wrong credentials
// Http Status 420 if wrong parameters
nexmo.number.buy('ES', 34911067000, function(err, res) { ... });
// Cancel an inbound number
// Required parameters:
// country-code : Country code (ex: ES).
// msisdn : An available inbound number (ex: 34911067000)
// Response:
// Http Status 200 if successful purchase
// Http Status 401 if wrong credentials
// Http Status 420 if wrong parameters
nexmo.number.cancel('ES', 34911067000, function(err, res) { ... });
I'll be adding more examples soon, including a fun example application (probably an article?). Please fork and contribute and send me pull requests. This was done in 2 hours time, so there might be some bugs somewhere. All tests pass for now. If you found a bug, but lazy to implement the solution don't hesitate to leave behind at least a failing test so I can fix it immediately. :)
(The MIT License)
Copyright (c) 2011 Shripad K <assortmentofsorts@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Nexmo Node Library
The npm package node-nexmo-api receives a total of 0 weekly downloads. As such, node-nexmo-api popularity was classified as not popular.
We found that node-nexmo-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.