New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nodebb/nodebb-plugin-import-users-csv

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nodebb/nodebb-plugin-import-users-csv - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

6

lib/controllers.js

@@ -8,2 +8,5 @@ 'use strict';

const nconf = require.main.require('nconf');
const meta = require.main.require('./src/meta');
const controllerHelpers = require.main.require('./src/controllers/helpers');

@@ -27,2 +30,3 @@

const { delimiter } = await meta.settings.get('import-users-csv');
const parseAsync = util.promisify(parse);

@@ -33,3 +37,3 @@ const { path } = req.files.upload;

let ignoreCount;
const records = await parseAsync(contents);
const records = await parseAsync(contents, { delimiter });
let { users, fields } = await main.normalizeCSV(records);

@@ -36,0 +40,0 @@ ({ users, ignoreCount } = await main.deduplicate(users));

18

library.js

@@ -0,1 +1,3 @@

/* eslint-disable no-await-in-loop */
'use strict';

@@ -21,13 +23,6 @@

// router.post('/import-users-csv', [(req, res, next) => {
// res.locals.isAPI = true;
// next();
// }, middleware.authenticateRequest, middleware.ensureLoggedIn], (req, res) => {
// console.log(req.body);
// });
routeHelpers.setupAdminPageRoute(router, '/admin/plugins/import-users-csv', controllers.renderAdminPage);
};
plugin.addRoutes = async ({ router, middleware, helpers }) => {
plugin.addRoutes = async ({ router, middleware/* , helpers */ }) => {
const controllers = require('./lib/controllers');

@@ -142,3 +137,8 @@ const middlewares = [

plugin.createUsers = async (users) => {
const uids = await Promise.all(users.map(async ({ username }) => await user.create({ username })));
// Create users in sync so as to not trip the locking mechanism on username dupes
const uids = [];
for (let x = 0; x < users.length; x++) {
const uid = await user.create({ username: users[x].username });
uids.push(uid);
}

@@ -145,0 +145,0 @@ // Automatically confirm emails + update fields

{
"name": "@nodebb/nodebb-plugin-import-users-csv",
"version": "1.0.3",
"version": "1.1.0",
"description": "A starter kit for quickly creating NodeBB plugins",

@@ -5,0 +5,0 @@ "main": "library.js",

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