stagas / confu Goto Github PK
View Code? Open in Web Editor NEWSimplistic config parsing for node.js
License: MIT License
Simplistic config parsing for node.js
License: MIT License
confu is a simplistic config parser for node.js Installation: npm install confu Usage: var config = require('confu')(__dirname, '../', 'config.json'); Also see example.js and config.json in the package Why is this even useful? Well, if you have a 'paths' hash in your config object, paths are resolved and normalized, relatively to the path of your config file, so you don't have to do it yourself. Also shamelessly adds a paths.root and paths.config path for convenience. So, in short, put your 'public', 'views' etc. paths in a 'paths' hash. Also saves you the trouble of requiring 'fs' and 'path' just to read a config file if you don't need them anywhere else. Example config.json: { "name": "myapp" , "host": "localhost" , "port": 80 , "paths": { "public": "./public" , "views": "./views" , "absolute": "/path/to/absolute/thing" } } In your app 'config' will look like: { name: 'myapp', host: 'localhost', port: 80, paths: { public: '/cygdrive/h/work/node/repos/confu/public', views: '/cygdrive/h/work/node/repos/confu/views', absolute: '/path/to/absolute/thing', root: '/cygdrive/h/work/node/repos/confu', config: '/cygdrive/h/work/node/repos/confu/config.json' } }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.