initial
This commit is contained in:
commit
59eedd6ec8
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
coverage/
|
||||||
|
pages/
|
||||||
|
public/
|
25
package.json
Normal file
25
package.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "smartipc",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "smart subprocess handling",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "(npmts)"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+ssh://git@gitlab.com/pushrocks/smartipc.git"
|
||||||
|
},
|
||||||
|
"author": "Lossless GmbH",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://gitlab.com/pushrocks/smartipc/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://gitlab.com/pushrocks/smartipc#README",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/lodash": "^4.14.36",
|
||||||
|
"beautylog": "^5.0.23",
|
||||||
|
"lodash": "^4.16.2",
|
||||||
|
"typings-global": "^1.0.14"
|
||||||
|
}
|
||||||
|
}
|
2
test/index.ts
Normal file
2
test/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './smartipc.classes.ipcserver'
|
||||||
|
export * from './smartipc.classes.ipcclient'
|
7
test/smartipc.classes.ipcclient.ts
Normal file
7
test/smartipc.classes.ipcclient.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import * as plugins from './smartipc.plugins'
|
||||||
|
|
||||||
|
export calss IpcClient {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
44
test/smartipc.classes.ipcserver.ts
Normal file
44
test/smartipc.classes.ipcserver.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import * as plugins from './smartipc.plugins'
|
||||||
|
|
||||||
|
interface IIpcServeOptions {
|
||||||
|
appspace?: string
|
||||||
|
socketRoot?: string
|
||||||
|
id?: string
|
||||||
|
networkHost?: string //should resolve to 127.0.0.1 or ::1 see the table below related to this
|
||||||
|
networkPort?: number
|
||||||
|
encoding?: string
|
||||||
|
rawBuffer?: boolean
|
||||||
|
sync?: boolean
|
||||||
|
silent?: boolean
|
||||||
|
logInColor?: boolean
|
||||||
|
logDepth?: number
|
||||||
|
maxConnections?: number
|
||||||
|
retry?: number
|
||||||
|
maxRetries?: boolean
|
||||||
|
stopRetrying?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
let defaultOptions: IIpcServeOptions = {
|
||||||
|
appspace: 'app.',
|
||||||
|
socketRoot: '/tmp/',
|
||||||
|
id: plugins.os.hostname(),
|
||||||
|
networkHost: 'localhost', //should resolve to 127.0.0.1 or ::1 see the table below related to this
|
||||||
|
networkPort: 8000,
|
||||||
|
encoding: 'utf8',
|
||||||
|
rawBuffer: false,
|
||||||
|
sync: false,
|
||||||
|
silent: false,
|
||||||
|
logInColor: true,
|
||||||
|
logDepth: 5,
|
||||||
|
maxConnections: 100,
|
||||||
|
retry: 500,
|
||||||
|
maxRetries: false,
|
||||||
|
stopRetrying: false
|
||||||
|
}
|
||||||
|
|
||||||
|
export class IpcServe {
|
||||||
|
ipcOptions: IIpcServeOptions
|
||||||
|
constructor(ipcOptionsArg: IIpcServeOptions) {
|
||||||
|
this.ipcOptions = plugins.lodash.merge({},defaultOptions,ipcOptionsArg)
|
||||||
|
}
|
||||||
|
}
|
5
test/smartipc.plugins.ts
Normal file
5
test/smartipc.plugins.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import 'typings-global'
|
||||||
|
export import beautylog = require('beautylog')
|
||||||
|
export import lodash = require('lodash')
|
||||||
|
export let nodeIpc = require('node-ipc')
|
||||||
|
export import os = require('os')
|
3
tslint.json
Normal file
3
tslint.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "tslint-config-standard"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user