make plugins in /node_modules optional (for use in runkit.com)
I'm trying to get littlefork-core
to run here: https://runkit.com/jywarren/littlefork-test
So that people can use it from Windows or whatever platform, in a browser, notebook-style.
But it's looking for /app/node_modules
which doesn't exist in this environment. The request is from a scan of the node_modules
folder from this line: https://gitlab.com/littlefork/littlefork-core/blob/master/lib/utils/plugins.js#L26
Potentially there's a way to find available/requireable modules here: https://github.com/npm/npm/issues/8061
But maybe better would be allow no plugins
to be defined in runner()
, here: https://gitlab.com/littlefork/littlefork-core/blob/master/lib/runner.js#L85
My usage is:
var littlefork = require('littlefork-core')
require("littlefork-plugin-twitter")
var config = {
"plugins": "twitter_search,twitter_feed",
"twitter": {
"consumer_key": "<your key here>",
"consumer_secret": "<your key here>",
"access_token_key": "<your key here>",
"access_token_secret": "<your key here>"
}
}
var queries = ['twitter_search:censorship']
console.log(littlefork.runner(config, queries))
Since I can just require()
the plugins, I'd prefer to be able to use runner()
without a node_modules
folder present. Thanks so much!!! With a little guidance maybe I could submit a PR.