Skip to content
Snippets Groups Projects
Commit 442a75c5 authored by Dante Aléo's avatar Dante Aléo :pouting_cat:
Browse files

started script to create db for users and machines

parent bb13ecce
No related branches found
No related tags found
1 merge request!50Login backend
Showing
with 769 additions and 25 deletions
{
"lockfileVersion": 1
}
// This file is part of the project Pinsis-Portal. // This file is part of the project Pinsis-Portal.
// Copyright (C),2018, by C3SL(Centro de Computação Científica e // Copyright (C),2018, by C3SL(Centro de Computação Científica e
// Software Live) // Software Live)
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
...@@ -26,7 +26,7 @@ declare var da: any; ...@@ -26,7 +26,7 @@ declare var da: any;
@Injectable() @Injectable()
export class DataApiService { export class DataApiService {
//Agent //Agent
public getAgentById(id,agents){ public getAgentById(id,agents){
var hospital = null; var hospital = null;
...@@ -37,7 +37,7 @@ export class DataApiService { ...@@ -37,7 +37,7 @@ export class DataApiService {
} }
return hospital; return hospital;
} }
public loadAgents(callback, countie = null){ public loadAgents(callback, countie = null){
var url = environment.webserviceUrl+"/api/data/listAgents"; var url = environment.webserviceUrl+"/api/data/listAgents";
if(countie) if(countie)
...@@ -47,30 +47,30 @@ export class DataApiService { ...@@ -47,30 +47,30 @@ export class DataApiService {
}); });
} }
// //
//Uses //Uses
/* /*
config format: config format:
{ {
"type": string "type": string
"y1": int, "y2": int, "m1": int, "y1": int, "y2": int, "m1": int,
"m2": int, "d1": int, "d2": int "m2": int, "d1": int, "d2": int
} }
type field must be 'day' or 'month' and its default value is 'day' type field must be 'day' or 'month' and its default value is 'day'
1 and 2 represents the intervale between dates (from 1 to 2) 1 and 2 represents the intervale between dates (from 1 to 2)
d = day; m = month; y = year; d = day; m = month; y = year;
To use day, its necessary set month, and to use month its To use day, its necessary set month, and to use month its
necessary to use year necessary to use year
If this fields are invalid or omited, all entries will be returned If this fields are invalid or omited, all entries will be returned
*/ */
public loadData(callback, config){ public loadData(callback, config){
var type = "agentusesday"; var type = "agentusesday";
...@@ -80,40 +80,40 @@ export class DataApiService { ...@@ -80,40 +80,40 @@ export class DataApiService {
}); });
} }
// //
//Geolocation //Geolocation
private cacheStates = null; private cacheStates = null;
public loadStates(callback){ public loadStates(callback){
var da = this; var da = this;
if(da.cacheStates != null){ if(da.cacheStates != null){
callback(this.cacheStates); callback(this.cacheStates);
return; return;
} }
$.getJSON(environment.webserviceUrl+"/geolocation/states.json", function(result){ $.getJSON(environment.webserviceUrl+"/geolocation/states.json", function(result){
var features = result.states; var features = result.states;
da.cacheStates = features; da.cacheStates = features;
callback(features); callback(features);
}); });
} }
public selectCountiesFromState(state, callback){ public selectCountiesFromState(state, callback){
$.getJSON(environment.webserviceUrl+"/geolocation/"+state+"-cities.json",function(result){ $.getJSON(environment.webserviceUrl+"/geolocation/"+state+"-cities.json",function(result){
var features = result.counties; var features = result.counties;
callback(features); callback(features);
}); });
} }
public selectStateFeature(state, callback){ public selectStateFeature(state, callback){
$.getJSON(environment.webserviceUrl+"/geolocation/"+state+".json",function(x){ $.getJSON(environment.webserviceUrl+"/geolocation/"+state+".json",function(x){
callback(x); callback(x);
}); });
} }
// //
constructor() { } constructor() { }
......
const pg = require('pg');
var pgtools = require('pgtools');
pgtools.createdb({
user: 'postgres',
host: '127.0.0.1',
password: '123',
port: '5432'},
'machines', function (err, res) {
if (err) {
console.error(err);
process.exit(-1);
}
console.log(res);
}
);
// pool.query("CREATE TABLE machine(numeroSerie SERIAL PRIMARY KEY )", (err, res) => {
// console.log(err, res);
// pool.end();
// });
// , localizacao point NOT NULL,
// ala VARCHAR(40) NOT NULL, estado VARCHAR(40), manutencao DATE
// pool.query("SELECT PacienteRegistro FROM Paciente", (err, res) => {
// console.log(err, res);
// pool.end();
// });
...@@ -3,7 +3,7 @@ var bcrypt = require('bcrypt'); ...@@ -3,7 +3,7 @@ var bcrypt = require('bcrypt');
const Schema = mongoose.Schema; const Schema = mongoose.Schema;
const userSchema = new Schema({ const userSchema = new Schema({
email: String, email: {type:String, unique: true},
password: String, password: String,
}); });
......
../pgtools/createdb.js
\ No newline at end of file
../pgtools/dropdb.js
\ No newline at end of file
../window-size/cli.js
\ No newline at end of file
language: node_js
node_js:
- 4
- 6
- 8
- 10
- 11
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# buffer-writer
[![Build Status](https://secure.travis-ci.org/brianc/node-buffer-writer.png?branch=master)](http://travis-ci.org/brianc/node-buffer-writer)
Fast & efficient buffer writer used to keep memory usage low by internally recycling a single large buffer.
Used as the binary protocol writer in [node-postgres](https://github.com/brianc/node-postgres)
Since postgres requires big endian encoding, this only writes big endian numbers for now, but can & probably will easily be extended to write little endian as well.
I'll admit this has a few postgres specific things I might need to take out in the future, such as `addHeader`
## api
`var writer = new (require('buffer-writer')());`
### writer.addInt32(num)
Writes a 4-byte big endian binary encoded number to the end of the buffer.
### writer.addInt16(num)
Writes a 2-byte big endian binary encoded number to the end of the buffer.
### writer.addCString(string)
Writes a string to the buffer `utf8` encoded and adds a null character (`\0`) at the end.
### var buffer = writer.addHeader(char)
Writes the 5 byte PostgreSQL required header to the beginning of the buffer. (1 byte for character, 1 BE Int32 for length of the buffer)
### var buffer = writer.join()
Collects all data in the writer and joins it into a single, new buffer.
### var buffer = writer.flush(char)
Writes the 5 byte postgres required message header, collects all data in the writer and joins it into a single, new buffer, and then resets the writer.
## thoughts
This is kind of node-postgres specific. If you're interested in using this for a more general purpose thing, lemme know.
I would love to work with you on getting this more reusable for your needs.
## license
MIT
//binary data writer tuned for creating
//postgres message packets as effeciently as possible by reusing the
//same buffer to avoid memcpy and limit memory allocations
var Writer = module.exports = function (size) {
this.size = size || 1024;
this.buffer = Buffer.alloc(this.size + 5);
this.offset = 5;
this.headerPosition = 0;
};
//resizes internal buffer if not enough size left
Writer.prototype._ensure = function (size) {
var remaining = this.buffer.length - this.offset;
if (remaining < size) {
var oldBuffer = this.buffer;
// exponential growth factor of around ~ 1.5
// https://stackoverflow.com/questions/2269063/buffer-growth-strategy
var newSize = oldBuffer.length + (oldBuffer.length >> 1) + size;
this.buffer = Buffer.alloc(newSize);
oldBuffer.copy(this.buffer);
}
};
Writer.prototype.addInt32 = function (num) {
this._ensure(4);
this.buffer[this.offset++] = (num >>> 24 & 0xFF);
this.buffer[this.offset++] = (num >>> 16 & 0xFF);
this.buffer[this.offset++] = (num >>> 8 & 0xFF);
this.buffer[this.offset++] = (num >>> 0 & 0xFF);
return this;
};
Writer.prototype.addInt16 = function (num) {
this._ensure(2);
this.buffer[this.offset++] = (num >>> 8 & 0xFF);
this.buffer[this.offset++] = (num >>> 0 & 0xFF);
return this;
};
//for versions of node requiring 'length' as 3rd argument to buffer.write
var writeString = function (buffer, string, offset, len) {
buffer.write(string, offset, len);
};
//overwrite function for older versions of node
if (Buffer.prototype.write.length === 3) {
writeString = function (buffer, string, offset, len) {
buffer.write(string, offset);
};
}
Writer.prototype.addCString = function (string) {
//just write a 0 for empty or null strings
if (!string) {
this._ensure(1);
} else {
var len = Buffer.byteLength(string);
this._ensure(len + 1); //+1 for null terminator
writeString(this.buffer, string, this.offset, len);
this.offset += len;
}
this.buffer[this.offset++] = 0; // null terminator
return this;
};
Writer.prototype.addChar = function (c) {
this._ensure(1);
writeString(this.buffer, c, this.offset, 1);
this.offset++;
return this;
};
Writer.prototype.addString = function (string) {
string = string || "";
var len = Buffer.byteLength(string);
this._ensure(len);
this.buffer.write(string, this.offset);
this.offset += len;
return this;
};
Writer.prototype.getByteLength = function () {
return this.offset - 5;
};
Writer.prototype.add = function (otherBuffer) {
this._ensure(otherBuffer.length);
otherBuffer.copy(this.buffer, this.offset);
this.offset += otherBuffer.length;
return this;
};
Writer.prototype.clear = function () {
this.offset = 5;
this.headerPosition = 0;
this.lastEnd = 0;
};
//appends a header block to all the written data since the last
//subsequent header or to the beginning if there is only one data block
Writer.prototype.addHeader = function (code, last) {
var origOffset = this.offset;
this.offset = this.headerPosition;
this.buffer[this.offset++] = code;
//length is everything in this packet minus the code
this.addInt32(origOffset - (this.headerPosition + 1));
//set next header position
this.headerPosition = origOffset;
//make space for next header
this.offset = origOffset;
if (!last) {
this._ensure(5);
this.offset += 5;
}
};
Writer.prototype.join = function (code) {
if (code) {
this.addHeader(code, true);
}
return this.buffer.slice(code ? 0 : 5, this.offset);
};
Writer.prototype.flush = function (code) {
var result = this.join(code);
this.clear();
return result;
};
{
"_from": "buffer-writer@2.0.0",
"_id": "buffer-writer@2.0.0",
"_inBundle": false,
"_integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
"_location": "/buffer-writer",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "buffer-writer@2.0.0",
"name": "buffer-writer",
"escapedName": "buffer-writer",
"rawSpec": "2.0.0",
"saveSpec": null,
"fetchSpec": "2.0.0"
},
"_requiredBy": [
"/pg"
],
"_resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"_shasum": "ce7eb81a38f7829db09c873f2fbb792c0c98ec04",
"_spec": "buffer-writer@2.0.0",
"_where": "/home/dante/Documents/pinsis-portal/server/node_modules/pg",
"author": {
"name": "Brian M. Carlson"
},
"bugs": {
"url": "https://github.com/brianc/node-buffer-writer/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "a fast, efficient buffer writer",
"devDependencies": {
"mocha": "5.2.0"
},
"engines": {
"node": ">=4"
},
"homepage": "https://github.com/brianc/node-buffer-writer#readme",
"keywords": [
"buffer",
"writer",
"builder"
],
"license": "MIT",
"main": "index.js",
"name": "buffer-writer",
"repository": {
"type": "git",
"url": "git://github.com/brianc/node-buffer-writer.git"
},
"scripts": {
"test": "mocha --throw-deprecation"
},
"version": "2.0.0"
}
--ui tdd
var Writer = require(__dirname + "/../");
var assert = require('assert');
var util = require('util');
assert.equalBuffers = function (actual, expected) {
var spit = function (actual, expected) {
console.log("");
console.log("actual " + util.inspect(actual));
console.log("expect " + util.inspect(expected));
console.log("");
};
if (actual.length != expected.length) {
spit(actual, expected);
assert.strictEqual(actual.length, expected.length);
}
for (var i = 0; i < actual.length; i++) {
if (actual[i] != expected[i]) {
spit(actual, expected);
}
assert.strictEqual(actual[i], expected[i]);
}
};
suite('adding int32', function () {
var testAddingInt32 = function (int, expectedBuffer) {
test('writes ' + int, function () {
var subject = new Writer();
var result = subject.addInt32(int).join();
assert.equalBuffers(result, expectedBuffer);
});
};
testAddingInt32(0, [0, 0, 0, 0]);
testAddingInt32(1, [0, 0, 0, 1]);
testAddingInt32(256, [0, 0, 1, 0]);
test('writes largest int32', function () {
//todo need to find largest int32 when I have internet access
return false;
});
test('writing multiple int32s', function () {
var subject = new Writer();
var result = subject.addInt32(1).addInt32(10).addInt32(0).join();
assert.equalBuffers(result, [0, 0, 0, 1, 0, 0, 0, 0x0a, 0, 0, 0, 0]);
});
suite('having to resize the buffer', function () {
test('after resize correct result returned', function () {
var subject = new Writer(10);
subject.addInt32(1).addInt32(1).addInt32(1);
assert.equalBuffers(subject.join(), [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]);
});
});
});
suite('int16', function () {
test('writes 0', function () {
var subject = new Writer();
var result = subject.addInt16(0).join();
assert.equalBuffers(result, [0, 0]);
});
test('writes 400', function () {
var subject = new Writer();
var result = subject.addInt16(400).join();
assert.equalBuffers(result, [1, 0x90]);
});
test('writes many', function () {
var subject = new Writer();
var result = subject.addInt16(0).addInt16(1).addInt16(2).join();
assert.equalBuffers(result, [0, 0, 0, 1, 0, 2]);
});
test('resizes if internal buffer fills up', function () {
var subject = new Writer(3);
var result = subject.addInt16(2).addInt16(3).join();
assert.equalBuffers(result, [0, 2, 0, 3]);
});
});
suite('cString', function () {
test('writes empty cstring', function () {
var subject = new Writer();
var result = subject.addCString().join();
assert.equalBuffers(result, [0]);
});
test('writes two empty cstrings', function () {
var subject = new Writer();
var result = subject.addCString("").addCString("").join();
assert.equalBuffers(result, [0, 0]);
});
test('writes non-empty cstring', function () {
var subject = new Writer();
var result = subject.addCString("!!!").join();
assert.equalBuffers(result, [33, 33, 33, 0]);
});
test('resizes if reached end', function () {
var subject = new Writer(3);
var result = subject.addCString("!!!").join();
assert.equalBuffers(result, [33, 33, 33, 0]);
});
test('writes multiple cstrings', function () {
var subject = new Writer();
var result = subject.addCString("!").addCString("!").join();
assert.equalBuffers(result, [33, 0, 33, 0]);
});
});
test('writes char', function () {
var subject = new Writer(2);
var result = subject.addChar('a').addChar('b').addChar('c').join();
assert.equalBuffers(result, [0x61, 0x62, 0x63]);
});
test('gets correct byte length', function () {
var subject = new Writer(5);
assert.strictEqual(subject.getByteLength(), 0);
subject.addInt32(0);
assert.strictEqual(subject.getByteLength(), 4);
subject.addCString("!");
assert.strictEqual(subject.getByteLength(), 6);
});
test('can add arbitrary buffer to the end', function () {
var subject = new Writer(4);
subject.addCString("!!!")
var result = subject.add(Buffer.from("@@@")).join();
assert.equalBuffers(result, [33, 33, 33, 0, 0x40, 0x40, 0x40]);
});
suite('can write normal string', function () {
var subject = new Writer(4);
var result = subject.addString("!").join();
assert.equalBuffers(result, [33]);
test('can write cString too', function () {
var result = subject.addCString("!").join();
assert.equalBuffers(result, [33, 33, 0]);
});
test('can resize', function () {
var result = subject.addString("!!").join();
assert.equalBuffers(result, [33, 33, 0, 33, 33]);
});
});
suite('clearing', function () {
var subject = new Writer();
subject.addCString("@!!#!#");
subject.addInt32(10401);
test('clears', function () {
subject.clear();
assert.equalBuffers(subject.join(), []);
});
test('writing more', function () {
var joinedResult = subject.addCString("!").addInt32(9).addInt16(2).join();
assert.equalBuffers(joinedResult, [33, 0, 0, 0, 0, 9, 0, 2]);
});
test('returns result', function () {
var flushedResult = subject.flush();
assert.equalBuffers(flushedResult, [33, 0, 0, 0, 0, 9, 0, 2])
});
test('clears the writer', function () {
assert.equalBuffers(subject.join(), [])
assert.equalBuffers(subject.flush(), [])
});
});
test("resizing to much larger", function () {
var subject = new Writer(2);
var string = "!!!!!!!!";
var result = subject.addCString(string).flush();
assert.equalBuffers(result, [33, 33, 33, 33, 33, 33, 33, 33, 0]);
});
suite("flush", function () {
test('added as a hex code to a full writer', function () {
var subject = new Writer(2);
var result = subject.addCString("!").flush(0x50);
assert.equalBuffers(result, [0x50, 0, 0, 0, 6, 33, 0]);
});
test('added as a hex code to a non-full writer', function () {
var subject = new Writer(10).addCString("!");
var joinedResult = subject.join(0x50);
var result = subject.flush(0x50);
assert.equalBuffers(result, [0x50, 0, 0, 0, 6, 33, 0]);
});
test('added as a hex code to a buffer which requires resizing', function () {
var result = new Writer(2).addCString("!!!!!!!!").flush(0x50);
assert.equalBuffers(result, [0x50, 0, 0, 0, 0x0D, 33, 33, 33, 33, 33, 33, 33, 33, 0]);
});
});
suite("header", function () {
test('adding two packets with headers', function () {
var subject = new Writer(10).addCString("!");
subject.addHeader(0x50);
subject.addCString("!!");
subject.addHeader(0x40);
subject.addCString("!");
var result = subject.flush(0x10);
assert.equalBuffers(result, [0x50, 0, 0, 0, 6, 33, 0, 0x40, 0, 0, 0, 7, 33, 33, 0, 0x10, 0, 0, 0, 6, 33, 0]);
});
});
'use strict';
function preserveCamelCase(str) {
var isLastCharLower = false;
for (var i = 0; i < str.length; i++) {
var c = str.charAt(i);
if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) {
str = str.substr(0, i) + '-' + str.substr(i);
isLastCharLower = false;
i++;
} else {
isLastCharLower = (c.toLowerCase() === c);
}
}
return str;
}
module.exports = function () {
var str = [].map.call(arguments, function (str) {
return str.trim();
}).filter(function (str) {
return str.length;
}).join('-');
if (!str.length) {
return '';
}
if (str.length === 1) {
return str.toLowerCase();
}
if (!(/[_.\- ]+/).test(str)) {
if (str === str.toUpperCase()) {
return str.toLowerCase();
}
if (str[0] !== str[0].toLowerCase()) {
return str[0].toLowerCase() + str.slice(1);
}
return str;
}
str = preserveCamelCase(str);
return str
.replace(/^[_.\- ]+/, '')
.toLowerCase()
.replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
return p1.toUpperCase();
});
};
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"_from": "camelcase@^3.0.0",
"_id": "camelcase@3.0.0",
"_inBundle": false,
"_integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
"_location": "/camelcase",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "camelcase@^3.0.0",
"name": "camelcase",
"escapedName": "camelcase",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/yargs-parser"
],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
"_shasum": "32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a",
"_spec": "camelcase@^3.0.0",
"_where": "/home/dante/Documents/pinsis-portal/server/node_modules/yargs-parser",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/camelcase/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/camelcase#readme",
"keywords": [
"camelcase",
"camel-case",
"camel",
"case",
"dash",
"hyphen",
"dot",
"underscore",
"separator",
"string",
"text",
"convert"
],
"license": "MIT",
"name": "camelcase",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/camelcase.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "3.0.0"
}
# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
## Install
```
$ npm install --save camelcase
```
## Usage
```js
const camelCase = require('camelcase');
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('--foo.bar');
//=> 'fooBar'
camelCase('__foo__bar__');
//=> 'fooBar'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase('foo', 'bar');
//=> 'fooBar'
camelCase('__foo__', '--bar');
//=> 'fooBar'
```
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
# Change Log
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="3.2.0"></a>
# [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)
### Bug Fixes
* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33))
### Features
* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32))
Copyright (c) 2015, Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment