0.5.1 • Published 4 years ago

@anysols/anysols-utils v0.5.1

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
4 years ago

Anysols Utils

Common utility functions used across anysols projects

Build Coverage Status CodeFactor

File Utils

//  Read a json file
const utils = require('@anysols/anysols-utils');
let obj = utils.readJsonFileSync('test/resources/sample.json');
console.log(JSON.stringify(obj)); // prints content of sample.json


//  Write to a json file
utils.writeJsonFileSync('test/resources/_temp_/write.json', {title: 'Write'});
let obj = utils.readJsonFileSync('test/resources/_temp_/write.json');
console.log(JSON.stringify(obj)); // prints {title: 'Write'}

String Utils

const utils = require('@anysols/anysols-utils');
const temp = utils.underscoreToCamelCase('hello_world');
console.log(temp); // prints 'Hello World'

Code of Conduct

Contributor Covenant

License

Apache License 2.0