login-keyborad-password
v0.0.1
Published
Utilidades JavaScript para browser e NodeJS
Downloads
7
Readme
linx-food-js
Utilidades para serem reaproveitadas em diversos projetos JavaScript (Browser e NodeJS).
Módulos específicos para browser devem ser colocados em modulos-browser.
A versão 0.0.1 é uma primeira extração de funcionalidades dos projetos existentes (DegustWeb, CentralDelivery, Indicadores e etc)
Instalação
npm install @linx.uxmobile/linx-food-js
Utilização no Browser
<script src="linx-food-js/dist/degust-js.min.js"></script>
<script type="text/javascript">
HttpClient.get('my/api/path', { some: 'value'}).then(function(xhr) {
console.log(xhr.responseText);
// Handle result
}).catch(function(err) {
// Handle error
});
JsonClient.post('my/api/path', {some: 'data'}).then(function(response){
// JsonClient parses the responseText into a JSON object
console.dir(response);
});
</script>
Utilização no Node
var DegustJS = require('linx-food-js');
var HttpClient = DegustJS.HttpClient;
var Seguranca = DegustJS.Seguranca;
Build
Para realizar o build do projeto (minificar e concatenar os módulos) é necessário instalar as dependências e executar o script de build:
npm install
npm run-script build
TODO
- Criar documentação dos módulos existentes
- Verificar a viabilidade/disponbilidade/custo-beneficio de separar cada módulo em um projeto separado