Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
1. Getting Started
Clone this wiki locally
OpenShare is extremely easy to get set up and rocking with. The fastest way to get started is to include a link from the CDN in a script tag just before your closing body tag.
<!doctype html> <body> <script src='https://cdn.rawgit.com/OpenShare/openshare/master/dist/openshare.js'></script> </body>
The CDN doesn't guarantee up time. If you want to be safe, you can download the minified openshare.js file directly and include in a script tag just before your closing body tag.
<!doctype html> <body> <script src='your-folder/openshare.js'></script> </body>
The best way to install OpenShare is through npm:
npm install openshare --save
require it in your js:
var OpenShare = require('openshare')
var shareNode = new OpenShare.share(options, element) var countNode = new OpenShare.count(options)
require('openshare') // data attribute API just works 🚀
NPM (custom builds)
You can also
require just the parts of OpenShare that you need. For example if you only need to create share nodes:
var share = require('openshare/share') var shareNode = new share(options, element)
Or if you only need to create count nodes:
var count = require('openshare/count') var countNode = new count(options)
Using npm but not a transpiler (like Babel)?
We include a pre-transpiled and minified ES5 version of OpenShare with the npm module.
var OpenShare = require('openshare/dist/openshare')