This commit is contained in:
Wolfgang Hottgenroth 2017-04-28 21:19:00 +02:00
commit d1bb5d07e8
4 changed files with 99 additions and 0 deletions

35
.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
# dependencies
/node_modules
/bower_components
# IDEs and editors
/.idea
/.vscode
.project
.classpath
.c9/
*.launch
.settings/
# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
#System Files
.DS_Store
Thumbs.db

22
package.json Normal file
View File

@ -0,0 +1,22 @@
{
"name": "mqtt_mongo",
"version": "1.0.0",
"description": "MQTT to MongoDB Gateway",
"main": "dist/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc -p ./",
"start": "node dist/main.js"
},
"author": "Wolfgang Hottgenroth",
"license": "ISC",
"devDependencies": {
"@types/commander": "^2.9.0",
"@types/node": "^7.0.14",
"typescript": "^2.3.1"
},
"dependencies": {
"commander": "^2.9.0",
"mqtt": "^2.6.2"
}
}

19
src/main.ts Normal file
View File

@ -0,0 +1,19 @@
class MqttMongo {
constructor() {
}
exec(): void {
console.log("Hello, %s", program['name'])
}
}
import program = require('commander')
program
.version('0.0.1')
.option('-n, --name [name]', 'Name to greet', 'Wolfgang')
.parse(process.argv)
const mqttMongo = new MqttMongo()
mqttMongo.exec()

23
tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"lib": ["es2015"],
"strictNullChecks": true,
"noImplicitAny": true,
"noEmitOnError": true,
"outDir": "dist",
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/*.*"
],
"exclude": [
"node_modules",
"dist"
]
}