🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

sms_bill

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sms_bill

A library to bill SMS messages according to encoding, escaped characters, etc

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
5
-50%
Maintainers
1
Weekly downloads
 
Created
Source

License npm version js-standard-style

Build Status Coverage Status Code Climate Issue Count

sms_bill

This library is used to bill SMS messages according to its encoding, number of segments, etc.

Installing

Add this library to your package.json configuration:

  "dependencies": {
    "sms_bill": "latest"
  }

Using it

  var sms_bill = require('sms_bill');
  var result = sms_bill.bill(text, segmentCost, encoding);
  • text: Is a string, the full text of the message to be billed.
  • segmentCost: Usually a float. Cost for each segment of the message.
  • encoding: Optional. If not present will try to autodetect the encoding and choose one of bit7 or ucs2. If present, will bill according to the maximum number of characters allowed per segment for the chosen encoding.

More examples can be found in the tests.

The result object will contain the total cost for the message, the number of segments billed, the encoding used, the maximum number of characters per segment allowed, and a lot more of information useful for debugging and tracing.

Encodings supported

Developers

This project uses standard npm scripts. Current tasks include:

  • test: Runs Mocha tests.
  • jsdoc: Runs JSDoc3.
  • eslint: Runs ESLint.
  • coverage: Runs the tests and then Instanbul to get a coverage report.
  • build: This is the default task, and will run all the other tasks.

Validating Input and Output

In the schema directory you will find the JSON Schema definitions.

Inputs

Outputs

Running an npm task

To run a task, just do:

npm run build

Contributing

To contribute:

  • Make sure you open a concise and short pull request.
  • Throw in any needed unit tests to accomodate the new code or the changes involved.
  • Run npm run build and make sure everything is ok before submitting the pull request (make eslint happy).
  • Your code must comply with the Javascript Standard Style, ESLint should take care of that.

License

The source code is released under Apache 2 License.

Check LICENSE file for more information.

Keywords

sms

FAQs

Package last updated on 08 Mar 2017

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