Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contentful-import

Package Overview
Dependencies
Maintainers
3
Versions
383
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-import - npm Package Compare versions

Comparing version 4.1.1 to 4.2.0

50

dist/index.js

@@ -43,4 +43,16 @@ 'use strict';

var _lodash = require('lodash');
var _cliTable = require('cli-table2');
var _cliTable2 = _interopRequireDefault(_cliTable);
var _moment = require('moment');
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var summary = {};
function runContentfulImport(usageParams) {

@@ -53,2 +65,4 @@ var defaultOpts = {

summary.startTime = (0, _moment2.default)();
var configFile = usageParams.config ? require((0, _path.resolve)(process.cwd(), usageParams.config)) : {};

@@ -121,8 +135,36 @@

skipContentPublishing: opts.skipContentPublishing
}).then(function (responses) {
_npmlog2.default.info('Successfully Imported all data');
return true;
});
}).then(function (response) {
_npmlog2.default.info('import', 'Finished importing all data');
var infoTable = new _cliTable2.default();
infoTable.push([{ colSpan: 2, content: 'The following entities were imported' }]);
Object.keys(opts.content).forEach(function (type) {
if (opts.skipLocales && type === 'locales') {
return;
}
if (opts.skipContentModel && type === 'contentTypes') {
return;
}
if (opts.contentModelOnly && !['contentTypes', 'locales'].includes(type)) {
return;
}
infoTable.push([(0, _lodash.startCase)(type), opts.content[type].length]);
});
console.log(infoTable.toString());
var durationHuman = summary.startTime.fromNow(true);
var durationSeconds = (0, _moment2.default)().diff(summary.startTime, 'seconds');
_npmlog2.default.info('import', `The import took ${durationHuman} (${durationSeconds}s)`);
return response;
}).catch(function (err) {
_npmlog2.default.error(err);
_npmlog2.default.error('import', err);
throw err;

@@ -129,0 +171,0 @@ });

4

package.json
{
"name": "contentful-import",
"version": "4.1.1",
"version": "4.2.0",
"description": "this tool allows you to import JSON dump exported by contentful-export",

@@ -52,5 +52,7 @@ "bin": {

"bluebird": "^3.3.3",
"cli-table2": "^0.2.0",
"contentful-batch-libs": "^5.3.0",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.0.0",
"moment": "^2.18.1",
"npmlog": "^4.0.0",

@@ -57,0 +59,0 @@ "yargs": "^7.0.2"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc