anchor.diff:          abstract undefined: obj with get, set
           abstract unescape: Func<string, string> with get, set
           abstract gc: Func<unit, unit> with get, set
  +        abstract v8debug: obj option with get, set
   
       and [<AllowNullLiteral>] Timer =
           abstract ref: unit -> unit
           abstract unref: unit -> unit
  -        
  -open NodeJS
  -
  -
  +
  +
  +type [<Erase>]Globals =
  +    [<Global>] static member ``process`` with get(): NodeJS.Process = jsNative and set(v: NodeJS.Process): unit = jsNative
  +    [<Global>] static member ``global`` with get(): NodeJS.Global = jsNative and set(v: NodeJS.Global): unit = jsNative
  +    [<Global>] static member console with get(): Console = jsNative and set(v: Console): unit = jsNative
  +    [<Global>] static member ___filename with get(): string = jsNative and set(v: string): unit = jsNative
  +    [<Global>] static member ___dirname with get(): string = jsNative and set(v: string): unit = jsNative
  +    [<Global>] static member require with get(): NodeRequire = jsNative and set(v: NodeRequire): unit = jsNative
  +    [<Global>] static member ``module`` with get(): NodeModule = jsNative and set(v: NodeModule): unit = jsNative
  +    [<Global>] static member exports with get(): obj = jsNative and set(v: obj): unit = jsNative
  +    [<Global>] static member SlowBuffer with get(): SlowBufferType = jsNative and set(v: SlowBufferType): unit = jsNative
  +    [<Global>] static member Buffer with get(): BufferType = jsNative and set(v: BufferType): unit = jsNative
  +
  +module buffer =
  +    type [<Import("*","buffer")>] Globals =
  +        static member INSPECT_MAX_BYTES with get(): float = jsNative and set(v: float): unit = jsNative
  +        static member BuffType with get(): obj = jsNative and set(v: obj): unit = jsNative
  +        static member SlowBuffType with get(): obj = jsNative and set(v: obj): unit = jsNative
  +
  +module querystring =
  +    type [<AllowNullLiteral>] StringifyOptions =
  +        abstract encodeURIComponent: Function option with get, set
  +
  +    and [<AllowNullLiteral>] ParseOptions =
  +        abstract maxKeys: float option with get, set
  +        abstract decodeURIComponent: Function option with get, set
  +
  +    type [<Import("*","querystring")>] Globals =
  +        static member stringify(obj: 'T, ?sep: string, ?eq: string, ?options: StringifyOptions): string = jsNative
  +        static member parse(str: string, ?sep: string, ?eq: string, ?options: ParseOptions): obj = jsNative
  +        static member parse(str: string, ?sep: string, ?eq: string, ?options: ParseOptions): 'T = jsNative
  +        static member escape(str: string): string = jsNative
  +        static member unescape(str: string): string = jsNative
  +
  +// net start
   module net_types =
       type [<AllowNullLiteral>] Socket =
  -        inherit NodeJS.ReadableStream
  +        inherit stream_types.Readable
           abstract writable: bool with get, set
           abstract _write: chunk: obj * encoding: string * callback: Function -> unit
           abstract write: chunk: obj * ?cb: Function -> bool
  
positive.code:         abstract getuid: unit -> float
          abstract setuid: id: float -> unit
          abstract setuid: id: string -> unit
          abstract kill: pid: float * ?signal: string -> unit
          abstract memoryUsage: unit -> obj
          abstract nextTick: callback: Function -> unit
          abstract umask: ?mask: float -> float
          abstract uptime: unit -> float
          abstract hrtime: ?time: ResizeArray<float> -> ResizeArray<float>
          abstract send: message: obj * ?sendHandle: obj -> unit
  
      and [<AllowNullLiteral>] Global =
          abstract Array: obj with get, set
  
negative.code: module Fable.Import.Node
  open System
  open System.Text.RegularExpressions
  open Fable.Core
  open Fable.Import.JS
  
  // Events start
  module event_types =
      type [<AllowNullLiteral>] EventEmitter =
          [<Emit("new $0()")>] abstract Create: unit -> EventEmitter
          abstract defaultMaxListeners: float with get, set
          abstract addListener: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract on: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract once: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract prependListener: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract prependOnceListener: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract removeListener: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract removeAllListener: ev: U2<string, Symbol> * listener: Function -> EventEmitter
          abstract setMaxListeners: n: int -> EventEmitter
          abstract getMaxListeners: unit -> int
          abstract listeners: ev: U2<string, Symbol> -> ResizeArray<Function>
          abstract emit: ev: string * [<ParamArray>] args: obj[] -> bool
          abstract eventNames: unit -> ResizeArray<U2<string, Symbol>>
          
      type Globals =
          member __.EventEmitter with get(): EventEmitter = jsNative and set(v: EventEmitter): unit = jsNative
  let [<Import("*","events")>] events: event_types.Globals = jsNative
  // Events end
  
  // Stream Start
  module stream_types =
      type [<AllowNullLiteral>] Stream =
          [<Emit("new $0()")>] abstract Create: unit -> Stream
          abstract pipe: destination: 'T * ?options: obj -> 'T
  
      and ReadableOptions = {
          highWaterMark: float option
          encoding: string;
          objectMode: bool option;
          read: Func<float, obj> option;
      }
  
      and [<AllowNullLiteral>] Readable =
          inherit Stream
          [<Emit("new $0($1)")>] abstract Create: ReadableOptions -> Readable
          abstract readable: bool with get, set
          abstract push: chunk: obj * ?encoding: string -> bool
          abstract unshift: chunk: obj -> unit
          abstract unpipe: ?destination: 'T -> unit
          abstract wrap: oldStream: Readable -> Readable
          abstract pause: unit -> Readable
          abstract resume: unit -> Readable
          abstract isPaused: unit -> bool
          abstract setEncoding: string -> unit
          abstract read: ?size: int -> U2<string option, Buffer option>
  
      and WritableOptions = {
          highWaterMark: float option;
          decodeStrings: bool option;
          objectMode: bool option;
          write: Func<U2<string, Buffer>, string, Function, obj> option;
          writev: Func<ResizeArray<obj>, Function, obj> option;
      }
  
      and [<AllowNullLiteral>] Writable =
          inherit Stream
          [<Emit("new $0($1)")>] abstract Create: WritableOptions -> Writable
          abstract writable: bool with get, set
          abstract write: chunk: obj * ?cb: Function -> bool
          abstract ``end``:unit -> unit
          abstract ``end``: obj: obj * ?cb: Function -> unit
          abstract ``end``: obj: obj * ?encoding: string * ?cb: Function -> unit
              
      type DuplexOptions = {
          decodeStrings: bool option;
          encoding: string;
          objectMode: bool option;
          allowHalfOpen: bool option;
          readableObjectMode: bool option;
          writableObjectMode: bool option;
          read: Func<float, obj> option;
          write: Func<U2<string, Buffer>, string, Function, obj> option;
          writev: Func<ResizeArray<obj>, Function, obj> option;
      }
  
      and [<AllowNullLiteral>] Duplex =
          inherit Readable
          inherit Writable
          [<Emit("new $0($1)")>] abstract Create: DuplexOptions -> Duplex
  
      and TransformOptions = {
          decodeStrings: bool option;
          encoding: string option;
          objectMode: bool option;
          allowHalfOpen: bool option;
          readableObjectMode: bool option;
          writableObjectMode: bool option;
          transform: Func<U2<string, Buffer>, string, Function, obj> option;
          flush: Func<Function, obj> option;
      }
  
      and [<AllowNullLiteral>] Transform = 
          inherit Readable
          inherit Writable
          [<Emit("new $0($1)")>] abstract Create: TransformOptions -> Transform
          abstract _transform: chunk: obj * encoding: string * callback: Function -> unit
          abstract _flush: callback: Function -> unit
  
      and [<AllowNullLiteral>] PassThrough =
          [<Emit("new $0()")>] abstract Create: unit -> PassThrough
          inherit Transform
      
      and Globals =
          member __.Stream with get(): Stream = jsNative and set(v: Stream): unit = jsNative
          member __.Readable with get(): Readable = jsNative and set(v: Readable): unit = jsNative
          member __.Writable with get(): Writable = jsNative and set(v: Writable): unit = jsNative
          member __.Duplex with get(): Duplex = jsNative and set(v: Duplex): unit = jsNative
          member __.TransformOptions with get(): TransformOptions = jsNative and set(v: TransformOptions): unit = jsNative
          member __.Transform with get(): Transform = jsNative and set(v: Transform): unit = jsNative
          member __.PassThrough with get(): PassThrough = jsNative and set(v: PassThrough): unit = jsNative
  
  
  let [<Import("*","stream")>] stream: stream_types.Globals = jsNative
  // Stream End
  
  
  type [<AllowNullLiteral>] Console =
      abstract ``assert``: value: obj * ?message: string * [<ParamArray>] optionalParams: obj[] -> unit
      abstract dir: obj: obj * ?options: obj -> unit
      abstract error: ?message: obj * [<ParamArray>] optionalParams: obj[] -> unit
      abstract info: ?message: obj * [<ParamArray>] optionalParams: obj[] -> unit
      abstract log: ?message: obj * [<ParamArray>] optionalParams: obj[] -> unit
      abstract time: label: string -> unit
      abstract timeEnd: label: string -> unit
      abstract trace: ?message: obj * [<ParamArray>] optionalParams: obj[] -> unit
      abstract warn: ?message: obj * [<ParamArray>] optionalParams: obj[] -> unit
  
  and [<AllowNullLiteral>] Error =
      abstract stack: string option with get, set
      abstract message: string option with get, set
  
  and [<AllowNullLiteral>] NodeRequireFunction =
      [<Emit("$0($1...)")>] abstract Invoke: id: string -> obj
  
  and [<AllowNullLiteral>] NodeRequire =
      inherit NodeRequireFunction
      abstract cache: obj with get, set
      abstract extensions: obj with get, set
      abstract main: obj with get, set
      abstract resolve: id: string -> string
  
  and [<AllowNullLiteral>] NodeModule =
      abstract exports: obj with get, set
      abstract require: NodeRequireFunction with get, set
      abstract id: string with get, set
      abstract filename: string with get, set
      abstract loaded: bool with get, set
      abstract parent: U2<NodeModule, obj> with get, set
      abstract ``null``: obj with get, set
      abstract children: ResizeArray<NodeModule> with get, set
  
  and [<AllowNullLiteral>] SlowBufferType =
      abstract prototype: Buffer with get, set
      [<Emit("new $0($1...)")>] abstract Create: str: string * ?encoding: string -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: size: float -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: size: Uint8Array -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: array: ResizeArray<obj> -> Buffer
      abstract isBuffer: obj: obj -> bool
      abstract byteLength: string: string * ?encoding: string -> float
      abstract concat: list: ResizeArray<Buffer> * ?totalLength: float -> Buffer
  
  and BufferEncoding =
      (* TODO StringEnum ascii | utf8 | utf16le | ucs2 | binary | hex *) string
  
  and [<AllowNullLiteral>] Buffer =
      inherit NodeBuffer
  
  
  and [<AllowNullLiteral>] BufferType =
      abstract prototype: Buffer with get, set
      [<Emit("new $0($1...)")>] abstract Create: str: string * ?encoding: string -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: size: float -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: array: Uint8Array -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: arrayBuffer: ArrayBuffer -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: array: ResizeArray<obj> -> Buffer
      [<Emit("new $0($1...)")>] abstract Create: buffer: Buffer -> Buffer
      abstract from: array: ResizeArray<obj> -> Buffer
      abstract from: arrayBuffer: ArrayBuffer * ?byteOffset: float * ?length: float -> Buffer
      abstract from: buffer: Buffer -> Buffer
      abstract from: str: string * ?encoding: string -> Buffer
      abstract isBuffer: obj: obj -> obj
      abstract isEncoding: encoding: string -> bool
      abstract byteLength: string: string * ?encoding: string -> float
      abstract concat: list: ResizeArray<Buffer> * ?totalLength: float -> Buffer
      abstract compare: buf1: Buffer * buf2: Buffer -> float
      abstract alloc: size: float * ?fill: U3<string, Buffer, float> * ?encoding: string -> Buffer
      abstract allocUnsafe: size: float -> Buffer
      abstract allocUnsafeSlow: size: float -> Buffer
  
  and [<AllowNullLiteral>] IterableIterator<'T> =
      interface end
  
  and [<AllowNullLiteral>] NodeBuffer =
      inherit Uint8Array
      abstract write: string: string * ?offset: float * ?length: float * ?encoding: string -> float
      abstract toString: ?encoding: string * ?start: float * ?``end``: float -> string
      abstract toJSON: unit -> obj
      abstract equals: otherBuffer: Buffer -> bool
      abstract compare: otherBuffer: Buffer * ?targetStart: float * ?targetEnd: float * ?sourceStart: float * ?sourceEnd: float -> float
      abstract copy: targetBuffer: Buffer * ?targetStart: float * ?sourceStart: float * ?sourceEnd: float -> float
      abstract slice: ?start: float * ?``end``: float -> Buffer
      abstract writeUIntLE: value: float * offset: float * byteLength: float * ?noAssert: bool -> float
  