0.3.0 • Published 2 years ago
@maytha8/compassedu v0.3.0
CompassEdu
Currently under development! A package for interacting with Compass Education.
Installation
The latest stable release is on npm, so you can use:
npm install @maytha8/compassedu
To install straight from the GitHub repository, use the following:
npm install https://github.com/Maytha8/CompassEdu
For contributing to this project, then use this:
git clone https://github.com/Maytha8/CompassEdu.git
cd CompassEdu
npm install
Usage
Promise syntax
const compassedu = require('compassedu');
const app = new compassedu('https://example.compass.education');
app.auth.authenticate('myUsername', 'myPassword')
.then(function() {
// your code here
})
.catch(function(err) {
// your error handling here
});
Async/Await syntax
const compassedu = require('compassedu');
const app = new compassedu('https://example.compass.education');
(async ()=>{
try {
await app.auth.authenticate('myUsername', 'myPassword');
// your code here
} catch (e) {
// your error handling here
}
})();
Top level await syntax (needs to be an ES module)
import * from compassedu;
const app = new compassedu('https://example.compass.education');
try {
await app.auth.authenticate('myUsername', 'myPassword');
// your code here
} catch (e) {
// your error handling here
}
The documentation and code reference can be found at https://maytha8.github.io/CompassEdu/.
What next?
- Follow the Getting Started tutorial.
- See the CompassEdu class for more information on its properties and methods.