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

csv-config

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-config - npm Package Compare versions

Comparing version 0.1.0 to 1.1.1

.gitlab-ci.yml

74

csv-config.js

@@ -1,9 +0,1 @@

//https://www.npmjs.com/package/role-based-email-addresses
//https://www.npmjs.com/package/disposable-email
//https://www.npmjs.com/package/disposable-email-domains
//https://www.npmjs.com/package/is-disposable-email
//module.exports.disposable_email_domains = require('./disposable_email_domains.json');
//module.exports.disposable_email_wildcard_domains = require('./disposable_email_domains.json');
//module.exports.useragents = require('./useragents.json');
//module.exports.miner_wordlist = require('./miner_wordlist.json');

@@ -13,20 +5,39 @@ const path = require('path');

const userHome = require('user-home');
const Papa = require('papaparse');
const parse = require("csv-parse/lib/sync");
var generate = require('csv-generate');
var CurrentConfigDir = "";
const Config = {};
const papa = require('papaparse');
const CONFIG = {};
function AutoKentConfig(isDev){
let cfgPathLocal = path.resolve(__dirname, "AutoKent");
let cfgPathHome = path.resolve(userHome, "AutoKent");
if(isDev){
CurrentConfigDir = cfgPathLocal;
// create a unique, global symbol name
const OBJ_KEY = Symbol.for("csv-config");
// check if the global object has this symbol
// add it if it does not have the symbol, yet
var globalSymbols = Object.getOwnPropertySymbols(global);
function CsvConfig(name,islocal){
if(globalSymbols.indexOf(OBJ_KEY) < 0){
global[OBJ_KEY] = CONFIG;
}
else{
CurrentConfigDir = cfgPathHome;
CONFIG = global[OBJ_KEY];
return CONFIG;
}
if(typeof name == "undefined") name = "csv-config";
if(typeof islocal == "undefined") islocal = false;
let cfgPathLocal = path.resolve(process.cwd(), name);;
let cfgPathHome = path.resolve(userHome, name);
if(islocal){
CONFIG['current-config-dir'] = cfgPathLocal;
}
else{
CONFIG['current-config-dir'] = cfgPathHome;
if( ! fs.pathExistsSync(cfgPathHome)){
fs.mkdirsSync(cfgPathHome);
fs.copySync(cfgPathLocal,cfgPathHome,{overwrite:true});
if(fs.pathExistsSync(cfgPathLocal)){
fs.copySync(cfgPathLocal,cfgPathHome,{overwrite:true});
}
}

@@ -38,3 +49,3 @@ }

var files = fs.readdirSync(CurrentConfigDir);
var files = fs.readdirSync( CONFIG['current-config-dir']);

@@ -45,15 +56,15 @@ for(var i in files) {

let base_name = path.basename(files[i],ext_name);
let file_path = path.resolve(CurrentConfigDir,files[i]);
let file_path = path.resolve(CONFIG['current-config-dir'],files[i]);
let file_text = fs.readFileSync(file_path,'utf8');
Config[base_name] = Papa.parse(file_text,parse_config);
CONFIG[base_name] = papa.parse(file_text,parse_config);
}
}
Config['save'] = function (){
for (const [key, value] of Object.entries(Config))
CONFIG['save'] = function (){
for (const [key, value] of Object.entries(CONFIG))
{
if(typeof(value) !== 'function')
if(typeof(value) !== 'function' && key != 'current-config-dir')
{
let text = Papa.unparse(Config[key].data,unparse_config);
let file_path = path.resolve(CurrentConfigDir,`${key}.csv`);
let text = papa.unparse(CONFIG[key].data,unparse_config);
let file_path = path.resolve( CONFIG['current-config-dir'] ,`${key}.csv`);
fs.writeFileSync(file_path,text,'utf8');

@@ -63,10 +74,11 @@ }

};
return Config;
return CONFIG;
};
module.exports = AutoKentConfig;
module.exports = CsvConfig;
//for testing purpose
if (!module.parent)
{
let config = AutoKentConfig(false);
let config = CsvConfig("CsvConfig",true);
config['atwords'].data[0][1] ++;

@@ -73,0 +85,0 @@ config['dotwords'].data[0][1] ++;

{
"name": "csv-config",
"version": "0.1.0",
"description": "A simple email extractor for obfosucated emails.",
"version": "1.1.1",
"description": "A `CSV` config parser and serializer for node.",
"main": "csv-config.js",
"keywords":[
"normalize",
"url",
"uri"
"keywords": [
"csv-config",
"config",
"csv",
"parser",
"serializer",
"ini",
"conf",
"configuration"
],
"dependencies": {
"escape-string-regexp": "*"
"path": "^0.12.7",
"fs-extra": "^4.0.3",
"user-home": "^2.0.0",
"papaparse": "^4.3.6"
},

@@ -20,19 +28,19 @@ "devDependencies": {

"scripts": {
"test": "mocha --recursive",
"start": "node csv-config.js"
"start": "node csv-config.js",
"test": "mocha --recursive"
},
"homepage":"https://gitlab.com/mehmet.kozan/csv-config",
"bugs" :{
"url" : "https://gitlab.com/mehmet.kozan/csv-config/issues",
"email" : "mehmet.kozan@live.com"
"bugs": {
"url": "https://gitlab.com/autokent/csv-config/issues",
"email": "mehmet.kozan@live.com"
},
"homepage": "https://gitlab.com/autokent/csv-config",
"repository": {
"type": "git",
"url": "https://gitlab.com/mehmet.kozan/csv-config.git"
"url": "https://gitlab.com/autokent/csv-config.git"
},
"author": "Mehmet Kozan",
"author": "Mehmet Kozan <mehmet.kozan@live.com>",
"license": "MIT",
"engines": {
"node": "8.2.1"
"node": ">= 4.0.0"
}
}
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