1.0.0 • Published 9 months ago
dmai-license v1.0.0
dmai-license
Dmai license service.
Installing
Package manager
Using npm:
$ npm install dmai-license --registry=https://nexus.dm-ai.com/repository/group-npm/
Using yarn:
$ yarn config set registry https://nexus.dm-ai.com/repository/group-npm/
$ yarn add dmai-license
Once the package is installed, you can import the library using import
or require
approach:
import dmaiLicense, {activeLicense, isActived} from 'dmai-license';
You can also use the default export, since the named export is just a re-export from the Axios factory:
import dmaiLicense from 'dmai-license';
console.log(dmaiLicense.activeLicense({ license: 'xxx' }));
If you use require
for importing, only default export is available:
const dmaiLicense = require('dmai-license');
console.log(dmaiLicense.activeLicense({ license: 'xxx' }));
Example
const { activeLicense, isActived } = require('dmai-license');
activeLicense({ license: 'xxx' })
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.finally(function () {
// always executed
});
isActived()
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.finally(function () {
// always executed
});
// Want to use async/await? Add the `async` keyword to your outer function/method.
async function mainAL() {
try {
const response = await activeLicense({ license: 'xxx' });
console.log(response);
} catch (error) {
console.error(error);
}
}
async function mainIA() {
try {
const response = await isActived();
console.log(response);
} catch (error) {
console.error(error);
}
}
Release notes
1.0.0 (2023-08-16)
Release dmai license service!
1.0.0
9 months ago