create-variable
Advanced tools
+13
-2
@@ -1,2 +0,2 @@ | ||
| function createVariable(name, value) { | ||
| function createGlobalVariable(name, value) { | ||
| let thingToPassInInObjectDotDefineProperty = { | ||
@@ -8,2 +8,13 @@ value: value | ||
| module.exports = createVariable | ||
| class GlobalVariable { | ||
| constructor(name, value) { | ||
| createGlobalVariable(name, value) | ||
| this.name = name | ||
| this.value = value | ||
| } | ||
| } | ||
| module.exports = { | ||
| createGlobalVariable, | ||
| GlobalVariable | ||
| } |
+2
-2
| { | ||
| "name": "create-variable", | ||
| "version": "1.0.0", | ||
| "description": "Creates a global variable when called with a name and value.", | ||
| "version": "2.0.0", | ||
| "description": "A global variable creator class and function.", | ||
| "main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
+7
-3
@@ -5,6 +5,10 @@ # create-variable | ||
| ```javascript | ||
| const createVariable = require('create-variable') | ||
| createVariable('test', 'hi') | ||
| const { createGlobalVariable, GlobalVariable } = require('create-variable') | ||
| createGlobalVariable('test', 'hi') | ||
| console.log(test) // hi | ||
| console.log(test) // Output: hi | ||
| new GlobalVariable('test2', 'bruh') | ||
| console.log(test2) // Output: bruh | ||
| ``` |
+6
-4
@@ -1,6 +0,8 @@ | ||
| const createVariable = require('../index') | ||
| createVariable('test', 'hi') | ||
| const { createGlobalVariable, GlobalVariable } = require('../index') | ||
| createGlobalVariable('test', 'hi') | ||
| const fun = require('./fun') | ||
| console.log(test) | ||
| fun() | ||
| new GlobalVariable('test2', 'bruh') | ||
| console.log(test2) |
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
1385
35.52%22
100%13
44.44%