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

@acryps/environment

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acryps/environment - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

42

built/index.js

@@ -123,9 +123,47 @@ "use strict";

}
const save = () => {
(0, fs_1.writeFileSync)(environmentSaveLocation, JSON.stringify(savedEnvironments, null, '\t'));
};
checkConfiguration(environmentConfiguration, []).then(async () => {
if (saveRequired) {
(0, fs_1.writeFileSync)(environmentSaveLocation, JSON.stringify(savedEnvironments, null, '\t'));
save();
}
switch (childProgram[0]) {
case '--switch': {
if (childProgram.length != 2) {
process.stderr.write(`missing arguments\nusage: environment --switch <setting>\nuse 'environment --settings' to list all previously created settings\n`);
return process.exit(1);
}
projectSettings.active = childProgram[1].trim();
if (projectSettings.active in projectSettings.settings) {
process.stdout.write(`switched to existing setting '${projectSettings.active}'\n`);
}
else {
process.stdout.write(`switched to new setting '${projectSettings.active}'\n`);
}
save();
return process.exit(0);
}
case '--active-setting': {
process.stdout.write(`${projectSettings.active}\n`);
return process.exit(0);
}
case '--settings': {
for (let setting in projectSettings.settings) {
process.stdout.write(`${setting}\n`);
}
return process.exit(0);
}
case '--import': {
if (childProgram.length != 2) {
process.stderr.write(`missing arguments\nusage: environment --import <exported blob>\n`);
return process.exit(1);
}
const settings = JSON.parse(Buffer.from(childProgram[1].trim(), 'base64').toString('utf-8'));
projectSettings.settings[projectSettings.active] = settings;
save();
return process.exit(0);
}
case '--export': {
process.stdout.write(`${Buffer.from(JSON.stringify(environment), 'utf-8').toString('base64')}\n`);
process.stdout.write(`environment --import ${Buffer.from(JSON.stringify(environment), 'utf-8').toString('base64')}\n`);
return process.exit(0);

@@ -132,0 +170,0 @@ }

2

documentation/example/package.json

@@ -15,4 +15,4 @@ {

"scripts": {
"start": "environment index.js"
"start": "environment node index.js"
}
}
{
"name": "@acryps/environment",
"version": "2.4.0",
"version": "2.5.0",
"license": "GPL-3.0-only",

@@ -5,0 +5,0 @@ "bin": {

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