@itxch/contentful-import
Version:
This tool allows you to import JSON dump exported by contentful-export
19 lines (18 loc) • 455 B
JavaScript
;
const contentfulManagement = require("contentful-management");
const logging_js = require("contentful-batch-libs/dist/logging.js");
function logHandler(level, data) {
logging_js.logEmitter.emit(level, data);
}
function initClient(opts) {
const defaultOpts = {
timeout: 3e4,
logHandler
};
const config = {
...defaultOpts,
...opts
};
return contentfulManagement.createClient(config);
}
module.exports = initClient;