See a live demo here.
Autofill address form fields based in a given CEP number, using the Postmon API.
Install MagicAddress in your project with:
npm i -S magic-address
Or manually grab a copy of magic-address.js
or magic-address.min.js
in dist
folder.
ES6 environment:
import MagicAddress from 'magic-address'
MagicAddress.start()
CommonJS environment:
var MagicAddress = require('magic-address')
MagicAddress.start()
Or in old school global reference for non ES6 / CommonJS environments:
MagicAddress.start()
You can pass options to .start()
method as well:
MagicAddress.start({
selectors: {
inputCEP: '.custom-cep-selector',
inputAddress: '.custom-address-selector',
inputNumber: '.custom-number-selector',
inputNeighborhood: '.custom-neighborhood-selector',
inputCity: '.custom-city-selector',
inputState: '.custom-state-selector'
}
})
- Drop
Promise
andObject.assign
polyfills, provide your own if you need it. - Switch build system from Webpack to Rollup.
- Old stuff like Grunt, Browserify, JSHint, JSCS were replaced in favor of Webpack, JSLint and NPM Scripts.
- Added a
LICENSE.txt
file, to follow proper licensing guidelines. - Removed unnecessary
demo
directory in project root.
- Add live demo.
- Update es6-promise polyfill.
- Use https to call the CEP API.
- Adjust the module export method. No more
.default
when importing the module.
- Add keywords in
package.json
.
- Initial release