Alexandre Germain

1

votes
2

answer
186

views

module `require` base path

I'm using Typescript. My sources are in src. When transpiling, Typescript outputs its results to the lib folder. Thus, when requiring my package components, I have to write the following: import { myModuleMain } from 'mylib/lib' import { ComponentA } from 'mylib/lib/ComponentA' import { ComponentB...
Alexandre Germain
1

votes
0

answer
311

views

Rollup: completely ignore modules

I'm trying to build a lib that works on both the browser & Node.js, with some slight differences. For instance, request should be done using the built-in browser's XMLHttpRequest, & request-promise on Node. Thus, I'd want rollup to completely ignore all import statements for request-promise, because...
1

votes
1

answer
671

views

Custom model attribute in waterline (nodejs)

I'm looking for a tip. I got a Waterline model, which have to be 'scanned' by a controller to perform an operation depending on each attribute's properties. Let me show you attributes: { bar: { model: 'Baz', MyCustomModule: {// should be ignored by Anchor's validation foo: false } }, bar: { type: 's...
Alexandre Germain
1

votes
1

answer
27

views

NLog: Generate configurations at runtime from template

I'm trying to generate targets & logger at runtime, based on another target. Let's assume that I have a functionnal Foo logger: I'd like to generate separate rules for Foo.1, Foo.2, etc etc, but I can't know what will be the last logger I'll have to create (thus, I can't define them declaratively)....
Alexandre Germain
1

votes
1

answer
67

views

Nodejs: Waterline + Caolan/Async: bind function

Using Balderdashy/Waterline and Caolan/Async, i'm trying to parallelize severa Waterline queries. Until now, the shorter I found is the following: const tasks = { foos: (function(){return this.exec.bind(this);}).apply(Foo.find({foo: 'foo'})), bars: (function(){return this.exec.bind(this);}).apply(Ba...
Alexandre Germain
2

votes
1

answer
355

views

Undefined reference to function of another lib

Yeah, I know many people asked that question before, but I still can't understand the problem in my case I have 2 libs, let's say liba & libb. libb uses liba but is compiled in .a so it should link at compile time. I have the following GCC command: gcc -o my_program obj/mymain.o obj/myutils.o liba/...
Alexandre Germain