Compare commits

...

147 Commits

Author SHA1 Message Date
117dc6013c 5.0.7 2023-10-03 18:54:52 +02:00
c6bc433a73 fix(core): update 2023-10-03 18:54:51 +02:00
299815838c switch to new org scheme 2023-07-11 00:36:49 +02:00
e8318cbf2f switch to new org scheme 2023-07-10 02:48:52 +02:00
ae60053cff 5.0.6 2023-02-12 19:08:40 +01:00
dca3cf1f08 fix(core): update 2023-02-12 19:08:40 +01:00
eaf379b119 5.0.5 2023-01-03 16:46:41 +01:00
0074938e57 fix(core): update 2023-01-03 16:46:41 +01:00
eed1c75aba 5.0.4 2022-12-28 19:43:49 +01:00
6de2f36964 fix(core): update 2022-12-28 19:43:48 +01:00
76e777a3ac 5.0.3 2022-08-07 01:17:45 +02:00
165cd3737e fix(core): update 2022-08-07 01:17:45 +02:00
2f11d1ba0f 5.0.2 2022-05-28 23:22:31 +02:00
33692ff417 fix(core): update 2022-05-28 23:22:31 +02:00
f408337186 5.0.1 2022-03-25 13:22:43 +01:00
bd6d574226 fix(core): update 2022-03-25 13:22:42 +01:00
d5c2d167ec 5.0.0 2022-03-16 16:10:47 +01:00
2af6d5a974 4.0.18 2022-03-16 16:10:09 +01:00
fdba21d60d 4.0.17 2022-03-16 16:09:25 +01:00
c17ebca309 fix(core): update 2022-03-16 16:09:24 +01:00
a014dcf1ab 4.0.16 2020-10-13 20:09:15 +00:00
44bee7bf6f fix(core): update 2020-10-13 20:09:15 +00:00
7841917058 4.0.15 2020-09-29 19:29:51 +00:00
f5a674f98d fix(core): update 2020-09-29 19:29:50 +00:00
80ece7c093 4.0.14 2020-09-29 19:10:00 +00:00
39250b3d47 fix(core): update 2020-09-29 19:10:00 +00:00
ed78c0becf 4.0.13 2020-09-29 18:38:22 +00:00
63c103fde5 fix(core): update 2020-09-29 18:38:21 +00:00
88003bde0f 4.0.12 2020-09-29 17:49:34 +00:00
276a0641e8 fix(core): update 2020-09-29 17:49:33 +00:00
b166269cb4 4.0.11 2020-09-29 10:23:08 +00:00
3ca1b425bf fix(core): update 2020-09-29 10:23:07 +00:00
ffc07da665 4.0.10 2020-06-25 23:00:33 +00:00
be2adaf259 fix(core): update 2020-06-25 23:00:32 +00:00
7aa9637826 4.0.9 2020-06-25 22:26:05 +00:00
a3c4f87741 fix(core): update 2020-06-25 22:26:04 +00:00
f005f57764 4.0.8 2020-06-25 22:23:10 +00:00
6e418cdbf8 fix(core): update 2020-06-25 22:23:10 +00:00
87155900e1 4.0.8 2019-11-15 20:59:04 +01:00
d24b11f737 fix(core): update 2019-11-15 20:59:02 +01:00
17ebd58951 4.0.7 2019-08-22 00:20:11 +02:00
32bd229f91 fix(core): update 2019-08-22 00:20:10 +02:00
4e5ddf8411 4.0.6 2019-06-17 08:54:47 +02:00
701c7c1b8b fix(core): update 2019-06-17 08:54:46 +02:00
9a272def16 4.0.5 2019-06-17 08:51:04 +02:00
0213950aae fix(core): update 2019-06-17 08:51:03 +02:00
b7342dbf05 4.0.4 2019-06-17 08:46:28 +02:00
677c8d33b9 fix(core): update 2019-06-17 08:46:28 +02:00
ffc781011d 4.0.3 2018-02-14 00:29:00 +01:00
aeec1b36a3 fix CI 2018-02-14 00:28:56 +01:00
4c2e7f9446 4.0.2 2018-02-14 00:15:51 +01:00
dddad457f3 update npmextra 2018-02-14 00:15:47 +01:00
4f110c6e64 4.0.1 2018-02-14 00:13:16 +01:00
12d971c470 update ci 2018-02-14 00:13:12 +01:00
886c245e8d 4.0.0 2018-02-14 00:12:25 +01:00
50d610e5df update smartenv to support os information on nodejs 2018-02-14 00:12:21 +01:00
5edb62c134 3.0.0 2017-05-25 01:33:20 +02:00
38f22a6d95 remove npmts.json 2017-05-25 01:33:15 +02:00
91cdb71388 Merge branch 'master' into 'master'
Update to latest standards

See merge request !1
2017-05-24 23:28:41 +00:00
ab33e97c8d streamline package 2017-05-17 15:59:10 +02:00
47f840841c 2.0.6 2017-04-21 00:11:11 +02:00
fe2210dc9f update readme 2017-04-21 00:11:06 +02:00
489ebab6ee 2.0.5 2017-04-21 00:04:31 +02:00
46baf07551 now has a env vars feature 2017-04-21 00:04:28 +02:00
cf0aabfbfc 2.0.4 2017-04-19 20:18:19 +02:00
a5005aeb96 2.0.3 2017-04-19 20:06:25 +02:00
a7e9f1303d update ci 2017-04-19 20:06:21 +02:00
92a6508c6a 2.0.2 2017-04-19 20:05:11 +02:00
32f6b5cbf8 update 2017-04-19 20:05:05 +02:00
bdfbcead8d 2.0.1 2017-04-19 20:02:46 +02:00
e73e704886 update dependencies to latest standards 2017-04-19 20:02:43 +02:00
efa818680a 2.0.0 2016-11-21 18:29:08 +01:00
572d85b3d3 prepare new major version 2016-11-21 18:29:02 +01:00
41e1386a8d 1.2.11 2016-11-21 18:28:08 +01:00
98d6f9e483 reverse to ES5 2016-11-21 18:28:06 +01:00
f295776bea 1.2.10 2016-11-21 14:51:39 +01:00
cde63e95a8 update repo links 2016-11-21 14:51:35 +01:00
6e4804a5ad 1.2.9 2016-11-21 14:47:30 +01:00
137592a19b update types 2016-11-21 14:47:24 +01:00
b850bc48cd 1.2.8 2016-11-21 12:11:53 +01:00
e1ce867493 update README 2016-11-21 12:11:49 +01:00
8e94ca9a60 1.2.7 2016-11-21 12:05:00 +01:00
81eaaaca90 update tests 2016-11-21 12:04:57 +01:00
340e7716f0 1.2.6 2016-11-21 11:58:41 +01:00
af7b9c46d2 update to latest standards 2016-11-21 11:58:37 +01:00
56d4432d31 Update README.md 2016-05-19 06:55:05 +02:00
324abf821e 1.2.5 2016-05-02 01:43:11 +02:00
fde407a762 update travis.yml 2016-05-02 01:43:07 +02:00
c9ac84954f update travis.yml 2016-05-02 01:41:57 +02:00
e0b4a93f1c 1.2.4 2016-05-02 01:30:02 +02:00
70015b5ffc now bundles typings 2016-05-02 01:29:42 +02:00
5a4d47411a 1.2.3 2016-04-05 15:53:54 +02:00
1730706034 fix package.json 2016-04-05 15:53:51 +02:00
7ecf342548 prepare for npmts-g 2016-04-05 15:13:52 +02:00
7f10392757 update dependencies and add caret to npmts dependency 2016-04-05 12:34:03 +02:00
9e229eee85 1.2.2 2016-04-05 01:07:24 +02:00
74c2c87f22 updated deps 2016-04-05 01:07:24 +02:00
0e0ee89263 1.2.1 2016-04-04 18:24:30 +02:00
a0e8f2f5e2 updated deps 2016-04-04 18:24:22 +02:00
043c5a0c6e 1.2.0 2016-03-03 01:50:17 +01:00
a1d5b4fc4e add isC9 to env 2016-03-03 01:50:13 +01:00
cd0b8f18af 1.1.0 2016-02-23 17:23:39 +01:00
d5387ddc05 1.0.10 2016-02-23 16:33:22 +01:00
3487b348df update deps 2016-02-23 16:31:50 +01:00
81036f8da3 1.0.9 2016-02-23 15:03:19 +01:00
b1464d97bf resolve dependency loop 2016-02-23 15:03:14 +01:00
5636cf330e 1.0.8 2016-02-23 14:36:20 +01:00
2e8b49fa18 update deps 2016-02-23 14:36:03 +01:00
df6036fbf1 1.0.7 2016-02-23 14:33:16 +01:00
8ec33947b6 update deps 2016-02-23 14:33:08 +01:00
50100115a6 1.0.6 2016-02-20 10:55:24 +01:00
8251e878c2 update deps 2016-02-20 10:55:19 +01:00
4a18d648c6 1.0.5 2016-02-20 10:50:38 +01:00
f9b89cc9db update object assignment 2016-02-20 10:50:32 +01:00
190aab3a11 1.0.4 2016-02-20 10:21:12 +01:00
cd26fffaf2 update travis 2016-02-20 10:21:09 +01:00
c2e48fa8b9 1.0.3 2016-02-20 10:11:32 +01:00
0db5ec169a add CI questions to Environment 2016-02-20 10:11:25 +01:00
0a29fafaeb update structure 2016-02-18 13:27:45 +01:00
0806fa9714 1.0.2 2016-02-18 13:16:21 +01:00
ef00c0d180 small structure update 2016-02-18 13:16:12 +01:00
b79c5fa293 1.0.1 2016-02-17 21:51:01 +01:00
ae8a09c294 cleanup 2016-02-17 21:50:48 +01:00
32a00aff01 added coveralls 2016-02-17 21:50:16 +01:00
77d96aaeff 1.0.0 2016-02-17 21:45:29 +01:00
beb65789dc 0.1.0 2016-02-17 21:45:23 +01:00
4a63b6a2c6 cleanup 2016-02-17 21:45:16 +01:00
340e971738 update to commonjs module structure 2016-02-17 21:44:40 +01:00
1d488c308e cleaned up 2015-12-26 01:11:46 +01:00
bfb9ebb994 0.0.15 2015-12-25 00:24:02 +01:00
84c25f3a67 cleaned up 2015-12-25 00:23:53 +01:00
1f4ffaff2a 0.0.14 2015-12-25 00:22:43 +01:00
101e7a86cd node vs browser env check is now working 2015-12-25 00:22:28 +01:00
acc0e5221b 0.0.13 2015-12-10 15:52:25 +01:00
a6839420f1 added merge and replace operations for objectstorage 2015-12-10 15:52:14 +01:00
2df7cf1467 0.0.12 2015-12-06 21:55:56 +01:00
bae4305dec update dependencies 2015-12-06 21:55:49 +01:00
1737075753 0.0.11 2015-12-06 21:50:05 +01:00
1a74ee8bb6 switched params for smartenv.obs.add() 2015-12-06 21:49:57 +01:00
28538001e9 0.0.10 2015-12-02 15:33:06 +01:00
9ec0b49716 refactored some functin names within obs module 2015-12-02 15:32:58 +01:00
cab52e1b02 0.0.9 2015-12-02 15:23:59 +01:00
d601a0eeb0 Merge branch 'master' of github.com:pushrocks/smartenv 2015-12-02 15:23:59 +01:00
491f22ffca clean up and fix some errors 2015-12-02 15:23:48 +01:00
1fec5323d9 closes #1 2015-12-01 08:29:58 +01:00
582afc0361 0.0.8 2015-11-30 20:01:08 +01:00
c054ecb0c7 cleaned up 2015-11-30 20:01:02 +01:00
40 changed files with 6004 additions and 2548 deletions

21
.gitignore vendored
View File

@ -1,3 +1,20 @@
.nogit/
# artifacts
coverage/
public/
pages/
# installs
node_modules/
.settings/
.idea/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_*/
# custom

6
.idea/vcs.xml generated
View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

4
.npmignore Normal file
View File

@ -0,0 +1,4 @@
node_modules/
coverage/
test/
ts/typings/

View File

@ -1,16 +0,0 @@
language: node_js
node_js:
- 4.2.2
before_install:
- npm install -g tsd
deploy:
provider: npm
email: npm@smart-coordination.com
api_key:
secure: uNjLbNelm8nj9R/tRlwRvcXWLS1QtA0QEbDKPDTWHNo68wAHgdwXIdzkVkNcihZYVasR/LqGuSLfzoD4H8mKmCXD+v85h048VmmtWniZQRp/OVWl0uzRwDDryhiYlhY5U9oOFEQsMO96C8qPqcGchq+DA7Gi3ZnAl7pmeb54xp9H+7jmLyZTyO8Hq00anV5PopBOW23mZEnWHznzYeg83BlWmLdbyfyZKT4W5Urg1BAMgxt9PdtrQoiPy4LP6AHXG88kvY3Iz8OBG+h/06bura8MPfeupGoktodN9krb+sRE/COybATWImMh9Z5gI5TWqUR7tp7XivpgolYY41gaN93oUQ9EOTdJ5kFku1dnPrNFqXO/97slVTMR6fMMgRXwzTz6BiKI1NsAZeW7oLUONw06APZ6VBhVY6Po3Rioun8OE9Q0wXm/BvnRqVHt3sew4MIgmEBwQSQE14gLJGGgNojzmcPstc0czQp+kzV5DpGiW3IWIWZ7MsBJOOJ13RHeb6koFdBR7JZj0QzzBcWD7juJVOS45MlP7hU/sKRDO/fN3nu8TNwHvJab6XYP5/gqlbh/3h2vb7bxyDXiKGi2Ds8hZOHoyWoCrU3sbH3eKKkKo+LFI3J7PbY11T6TkSAdszLsQzcvC2QlsGQRWVywYMm32R6BVfxF3AlLX5a8JsI=
on:
tags: true
repo: pushrocks/smartenv
notifications:
slack:
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=

11
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"type": "node-terminal"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}
}
}
}
]
}

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015 Push.Rocks
Copyright (c) 2015 Lossless GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,28 +0,0 @@
# smartenv
store things about your environment and let them travel across modules
## Status
[![Build Status](https://travis-ci.org/pushrocks/smartenv.svg?branch=release)](https://travis-ci.org/pushrocks/smartenv)
[![Dependency Status](https://david-dm.org/pushrocks/smartenv.svg)](https://david-dm.org/pushrocks/smartenv)
[![devDependency Status](https://david-dm.org/pushrocks/smartenv/dev-status.svg)](https://david-dm.org/pushrocks/smartenv#info=devDependencies)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartenv/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartenv/master/dependencies/npm)
[![bitHound Overalll Score](https://www.bithound.io/github/pushrocks/smartenv/badges/score.svg)](https://www.bithound.io/github/pushrocks/smartenv)
## Install
Install the package through npm
```
npm install smartenv
```
## Usage
```javascript
var smartenv = require("smartenv");
smartenv.info(); //prints an output about your current environment and registered objects
smartenv.register({akey:"a text"},"somevalue"); // register a new object
smartenv.makeGlobal() // make smartenv available from gobal.smartenv
smartenv.get("somevalue").akey; // returns "a text"
smartenv.items.somevalue.akey; // also returns "a text"
```

100
index.js
View File

@ -1,100 +0,0 @@
/// <reference path="index.ts" />
var Environment = (function () {
function Environment(runtimeEnvArg, userAgentArg) {
if (userAgentArg === void 0) { userAgentArg = "undefined"; }
this.runtimeEnv = runtimeEnvArg;
this.userAgent = userAgentArg;
if (runtimeEnvArg == "node") {
this.isBrowser = false;
this.isNode = true;
this.nodeVersion = process.version;
}
else {
this.isBrowser = true;
this.isNode = true;
this.nodeVersion = "undefined";
}
}
;
return Environment;
})();
/// <reference path="index.ts" />
/**
* Deals with the environment the current JS script is running in.
*/
var SmartenvEnvironment;
(function (SmartenvEnvironment) {
function init() {
var environment;
(function () {
var localRunTimeEnv = "undefined";
var localUserAgent = "undefined";
if (typeof window !== 'undefined') {
localRunTimeEnv = 'browser';
localUserAgent = navigator.userAgent;
}
else if (typeof process !== 'undefined') {
localRunTimeEnv = 'node';
}
environment = new Environment(localRunTimeEnv, localUserAgent);
})();
return function () {
return environment;
};
}
SmartenvEnvironment.init = init;
})(SmartenvEnvironment || (SmartenvEnvironment = {}));
/// <reference path="index.ts" />
var SmartenvObjectStorage;
(function (SmartenvObjectStorage) {
function init() {
var obs = {};
var obsItems = {};
obs.addItem = function (objectArg, paramName) {
if (paramName === void 0) { paramName = "undefined"; }
if (paramName == "undefined") {
plugins.beautylog.error("paramName is undefined");
return;
}
obsItems[paramName] = objectArg;
};
obs.getItem = function (keyName) {
return obsItems[keyName];
};
obs.getComplete = function () {
return obsItems;
};
obs.addComplete = function (itemsArg) {
obsItems = plugins._.assign(obsItems, itemsArg);
return obsItems;
};
return obs;
}
SmartenvObjectStorage.init = init;
})(SmartenvObjectStorage || (SmartenvObjectStorage = {}));
/// <reference path="typings/tsd.d.ts" />
/// <reference path="smartenv.classes.ts" />
/// <reference path="smartenv.environment.ts" />
/// <reference path="smartenv.objectstorage.ts" />
var plugins = {
beautylog: require("beautylog")("os"),
_: require("lodash")
};
var smartenv = {}; //create smartenv object
smartenv.getEnv = SmartenvEnvironment.init();
smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
* ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function () {
if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent);
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv;

17
npmextra.json Normal file
View File

@ -0,0 +1,17 @@
{
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "push.rocks",
"gitrepo": "smartenv",
"description": "store things about your environment and let them travel across modules",
"npmPackagename": "@push.rocks/smartenv",
"license": "MIT"
}
}
}

View File

@ -1,33 +1,55 @@
{
"name": "smartenv",
"version": "0.0.7",
"name": "@push.rocks/smartenv",
"version": "5.0.7",
"description": "store things about your environment and let them travel across modules",
"main": "index.js",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": {
"test": "(cd ts/compile && node compile.js) && (node test.js)",
"reinstall": "(rm -r node_modules && npm install)",
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
"startdev": "(git checkout master && git pull origin master && npm install)"
"test": "(tstest test/ --web)",
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
"testbrowser": "(npm test) && (node testbrowser.js)",
"buildDocs": "tsdoc"
},
"repository": {
"type": "git",
"url": "https://github.com/pushrocks/smartenv.git"
"url": "https://gitlab.com/pushrocks/smartenv.git"
},
"keywords": [
"environment"
],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"author": "Lossless GmbH <hello@lossless.support> (https://lossless.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/pushrocks/smartenv/issues"
"url": "https://gitlab.com/pushrocks/smartenv/issues"
},
"homepage": "https://github.com/pushrocks/smartenv",
"homepage": "https://gitlab.com/pushrocks/smartenv",
"dependencies": {
"beautylog": "^1.0.4",
"lodash": "^3.10.1"
"@push.rocks/smartpromise": "^4.0.2"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-typescript": "^2.9.2"
}
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsbundle": "^2.0.8",
"@git.zone/tsrun": "^1.2.44",
"@git.zone/tstest": "^1.0.77",
"@push.rocks/tapbundle": "^5.0.8",
"@types/node": "^20.8.2",
"@types/npm": "^7.19.1"
},
"private": false,
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
]
}

5633
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

37
readme.md Normal file
View File

@ -0,0 +1,37 @@
# @push.rocks/smartenv
store things about your environment and let them travel across modules
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartenv)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartenv)
* [github.com (source mirror)](https://github.com/pushrocks/smartenv)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartenv/)
## Status for master
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartenv/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartenv/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartenv)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartenv)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartenv)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartenv)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartenv)](https://lossless.cloud)
## Usage
Use TypeScript for best in class instellisense.
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
For further information read the linked docs at the top of this readme.
## Legal
> MIT licensed | **&copy;** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)

14
test.js
View File

@ -1,14 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
var smartenv = require("./index.js");
var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module");
smartenv.printEnv();
beautylog.info("Now testing the smartenv module");
smartenv.obs.addItem({ key1: "Peter" }, "docit");
smartenv.printEnv();
beautylog.log(smartenv.obs.getItem("docit").key1);
beautylog.log(smartenv.obs.getItem("docit").key1);
var key2 = "hello";
smartenv.obs.getItem("docit").key2 = key2;
beautylog.log(smartenv.obs.getItem("docit").key2);
beautylog.success("Success!");

37
test/test.ts Normal file
View File

@ -0,0 +1,37 @@
import { tap, expect } from '@push.rocks/tapbundle';
import * as smartenv from '../ts/index.js';
let testEnv: smartenv.Smartenv;
tap.test('should print env', async () => {
testEnv = new smartenv.Smartenv();
});
tap.test('should print a overview to console', async () => {
testEnv.printEnv();
});
tap.test('should get os', async () => {
const resultMac = await testEnv.isMacAsync();
const resultLinux = await testEnv.isLinuxAsync();
const resultWindows = await testEnv.isWindowsAsync();
const osModule = await import('os');
if (resultMac) {
expect(osModule.platform()).toEqual('darwin');
console.log('platform is Mac!');
} else if (resultLinux) {
expect(osModule.platform()).toEqual('linux');
console.log('platform is Linux!');
} else {
expect(osModule.platform()).toEqual('win32');
console.log('platform is Windows!');
}
});
tap.test('should state wether we are in CI', async () => {
if (process.env.CI) {
expect(testEnv.isCI).toBeTrue();
}
});
tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartenv',
version: '5.0.7',
description: 'store things about your environment and let them travel across modules'
}

View File

@ -1,28 +0,0 @@
// import gulp
var gulp = require("gulp");
var gulpTypescript = require("gulp-typescript");
var bl = require("beautylog")("os");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('compileTestTS', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTestTS'], function() {
bl.success('Typescript compiled');
});
gulp.start.apply(gulp, ['default']);

View File

@ -1,2 +0,0 @@
# How to compile.
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.

View File

@ -1,27 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
/// <reference path="smartenv.classes.ts" />
/// <reference path="smartenv.environment.ts" />
/// <reference path="smartenv.objectstorage.ts" />
var plugins = {
beautylog: require("beautylog")("os"),
_: require("lodash")
};
var smartenv = {}; //create smartenv object
smartenv.getEnv = SmartenvEnvironment.init();
smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
* ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function () {
if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent);
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv;
//# sourceMappingURL=index.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,4CAA4C;AAC5C,gDAAgD;AAChD,kDAAkD;AAClD,IAAI,OAAO,GAAG;IACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;CACvB,CAAA;AACD,IAAI,QAAQ,GAAO,EAAE,CAAC,CAAC,wBAAwB;AAE/C,QAAQ,CAAC,MAAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAC7C,QAAQ,CAAC,GAAG,GAAG,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAG5C;;+CAE+C;AAC/C,QAAQ,CAAC,QAAQ,GAAG;IAChB,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3B,IAAI,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC;QACxD,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,WAAW,GAAG,2BAA2B,GAAG,eAAe,CAAC,CAAC;IAC9H,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACnG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC,CAAC;AAIF,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC"}

View File

@ -1,31 +1 @@
/// <reference path="typings/tsd.d.ts" />
/// <reference path="smartenv.classes.ts" />
/// <reference path="smartenv.environment.ts" />
/// <reference path="smartenv.objectstorage.ts" />
var plugins = {
beautylog: require("beautylog")("os"),
_: require("lodash")
}
var smartenv:any = {}; //create smartenv object
smartenv.getEnv = SmartenvEnvironment.init();
smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
* ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function() {
if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
} else {
plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent)
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv;
export * from './smartenv.classes.smartenv.js';

9
ts/interfaces/index.ts Normal file
View File

@ -0,0 +1,9 @@
export let defaultme = null;
declare global {
namespace NodeJS {
interface Global {
window: any;
navigator: any;
}
}
}

View File

@ -1,21 +0,0 @@
/// <reference path="index.ts" />
var Environment = (function () {
function Environment(runtimeEnvArg, userAgentArg) {
if (userAgentArg === void 0) { userAgentArg = "undefined"; }
this.runtimeEnv = runtimeEnvArg;
this.userAgent = userAgentArg;
if (runtimeEnvArg == "node") {
this.isBrowser = false;
this.isNode = true;
this.nodeVersion = process.version;
}
else {
this.isBrowser = true;
this.isNode = true;
this.nodeVersion = "undefined";
}
}
;
return Environment;
})();
//# sourceMappingURL=smartenv.classes.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"smartenv.classes.js","sourceRoot":"","sources":["smartenv.classes.ts"],"names":["Environment","Environment.constructor"],"mappings":"AAAA,iCAAiC;AACjC;IAMIA,qBAAYA,aAAaA,EAACA,YAA0BA;QAA1BC,4BAA0BA,GAA1BA,0BAA0BA;QAChDA,IAAIA,CAACA,UAAUA,GAAGA,aAAaA,CAACA;QAChCA,IAAIA,CAACA,SAASA,GAAGA,YAAYA,CAACA;QAC9BA,EAAEA,CAAAA,CAACA,aAAaA,IAAIA,MAAMA,CAACA,CAAAA,CAACA;YACxBA,IAAIA,CAACA,SAASA,GAAGA,KAAKA,CAACA;YACvBA,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA;YACnBA,IAAIA,CAACA,WAAWA,GAAGA,OAAOA,CAACA,OAAOA,CAACA;QACvCA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,IAAIA,CAACA,SAASA,GAAGA,IAAIA,CAACA;YACtBA,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA;YACnBA,IAAIA,CAACA,WAAWA,GAAGA,WAAWA,CAACA;QACnCA,CAACA;IACLA,CAACA;;IACLD,kBAACA;AAADA,CAACA,AAnBD,IAmBC"}

View File

@ -0,0 +1,151 @@
import * as plugins from './smartenv.plugins.js';
import * as interfaces from './interfaces/index.js';
// interfaces
export interface IEnvObject {
name: string;
value: string;
}
/**
* Smartenv class that makes it easy
*/
export class Smartenv {
public async getEnvAwareModule(optionsArg: {
nodeModuleName: string;
webUrlArg: string;
getFunction: () => any;
}) {
if (this.isNode) {
const moduleResult = await this.getSafeNodeModule(optionsArg.nodeModuleName);
return moduleResult;
} else if (this.isBrowser) {
const moduleResult = await this.getSafeWebModule(
optionsArg.webUrlArg,
optionsArg.getFunction
);
return moduleResult;
} else {
console.error('platform for loading not supported by smartenv');
}
}
public async getSafeNodeModule<T = any>(moduleNameArg: string): Promise<T> {
if (!this.isNode) {
console.error(`You tried to load a node module in a wrong context: ${moduleNameArg}`);
return;
}
// tslint:disable-next-line: function-constructor
return new Function(`return import('${moduleNameArg}')`)() as Promise<T>;
}
public loadedScripts: string[] = [];
public async getSafeWebModule(urlArg: string, getFunctionArg: () => any) {
if (!this.isBrowser) {
console.error('You tried to load a web module in a wrong context');
return;
}
if (this.loadedScripts.includes(urlArg)) {
return getFunctionArg();
} else {
this.loadedScripts.push(urlArg);
}
const done = plugins.smartpromise.defer();
if (globalThis.importScripts) {
globalThis.importScripts(urlArg);
done.resolve();
} else {
const script = document.createElement('script');
script.onload = () => {
done.resolve();
};
script.src = urlArg;
document.head.appendChild(script);
}
await done.promise;
return getFunctionArg();
}
public get runtimeEnv() {
if (typeof process !== 'undefined') {
return 'node';
} else {
return 'browser';
}
}
public get isBrowser(): boolean {
return !this.isNode;
}
public get userAgent(): string {
if (this.isBrowser) {
// make sure we are in Browser
return navigator.userAgent;
} else {
return 'undefined';
}
}
public get isNode(): boolean {
return this.runtimeEnv === 'node';
}
public get nodeVersion(): string {
return process.version;
}
public get isCI(): boolean {
if (this.isNode) {
if (process.env.CI) {
return true;
} else {
return false;
}
} else {
return false;
}
}
public async isMacAsync(): Promise<boolean> {
if (this.isNode) {
const os = await this.getSafeNodeModule('os');
return os.platform() === 'darwin';
} else {
return false;
}
}
public async isWindowsAsync(): Promise<boolean> {
if (this.isNode) {
const os = await this.getSafeNodeModule('os');
return os.platform() === 'win32';
} else {
return false;
}
}
public async isLinuxAsync(): Promise<boolean> {
if (this.isNode) {
const os = await this.getSafeNodeModule('os');
return os.platform() === 'linux';
} else {
return false;
}
}
/**
* prints the environment to console
*/
public async printEnv() {
if (this.isNode) {
console.log('running on NODE');
console.log('node version is ' + this.nodeVersion);
} else {
console.log('running on BROWSER');
console.log('browser is ' + this.userAgent);
}
}
}

View File

@ -1,21 +0,0 @@
/// <reference path="index.ts" />
class Environment {
public runtimeEnv:string;
public userAgent:string;
public nodeVersion;
public isBrowser:boolean;
public isNode:boolean;
constructor(runtimeEnvArg,userAgentArg = "undefined") {
this.runtimeEnv = runtimeEnvArg;
this.userAgent = userAgentArg;
if(runtimeEnvArg == "node"){
this.isBrowser = false;
this.isNode = true;
this.nodeVersion = process.version;
} else {
this.isBrowser = true;
this.isNode = true;
this.nodeVersion = "undefined";
}
};
}

View File

@ -1,27 +0,0 @@
/// <reference path="index.ts" />
/**
* Deals with the environment the current JS script is running in.
*/
var SmartenvEnvironment;
(function (SmartenvEnvironment) {
function init() {
var environment;
(function () {
var localRunTimeEnv = "undefined";
var localUserAgent = "undefined";
if (typeof window !== 'undefined') {
localRunTimeEnv = 'browser';
localUserAgent = navigator.userAgent;
}
else if (typeof process !== 'undefined') {
localRunTimeEnv = 'node';
}
environment = new Environment(localRunTimeEnv, localUserAgent);
})();
return function () {
return environment;
};
}
SmartenvEnvironment.init = init;
})(SmartenvEnvironment || (SmartenvEnvironment = {}));
//# sourceMappingURL=smartenv.environment.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"smartenv.environment.js","sourceRoot":"","sources":["smartenv.environment.ts"],"names":["SmartenvEnvironment","SmartenvEnvironment.init"],"mappings":"AAAA,iCAAiC;AACjC;;GAEG;AACH,IAAO,mBAAmB,CAoBzB;AApBD,WAAO,mBAAmB,EAAC,CAAC;IACxBA;QACIC,IAAIA,WAAuBA,CAACA;QAC5BA,CAACA;YACG,IAAI,eAAe,GAAG,WAAW,CAAC;YAClC,IAAI,cAAc,GAAG,WAAW,CAAC;YACjC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;gBAChC,eAAe,GAAG,SAAS,CAAC;gBAC5B,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC;YACzC,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC;gBACxC,eAAe,GAAG,MAAM,CAAC;YAC7B,CAAC;YACD,WAAW,GAAG,IAAI,WAAW,CAAC,eAAe,EAAC,cAAc,CAAC,CAAC;QAClE,CAAC,CAACA,EAAEA,CAACA;QAGLA,MAAMA,CAACA;YACH,MAAM,CAAC,WAAW,CAAC;QACvB,CAAC,CAACA;IACNA,CAACA;IAlBeD,wBAAIA,OAkBnBA,CAAAA;AACLA,CAACA,EApBM,mBAAmB,KAAnB,mBAAmB,QAoBzB"}

View File

@ -1,25 +0,0 @@
/// <reference path="index.ts" />
/**
* Deals with the environment the current JS script is running in.
*/
module SmartenvEnvironment {
export function init(){
var environment:Environment;
(function() {
var localRunTimeEnv = "undefined";
var localUserAgent = "undefined";
if (typeof window !== 'undefined') {
localRunTimeEnv = 'browser';
localUserAgent = navigator.userAgent;
} else if (typeof process !== 'undefined') {
localRunTimeEnv = 'node';
}
environment = new Environment(localRunTimeEnv,localUserAgent);
})();
return function() {
return environment;
};
}
}

View File

@ -1,29 +0,0 @@
/// <reference path="index.ts" />
var SmartenvObjectStorage;
(function (SmartenvObjectStorage) {
function init() {
var obs = {};
var obsItems = {};
obs.addItem = function (objectArg, paramName) {
if (paramName === void 0) { paramName = "undefined"; }
if (paramName == "undefined") {
plugins.beautylog.error("paramName is undefined");
return;
}
obsItems[paramName] = objectArg;
};
obs.getItem = function (keyName) {
return obsItems[keyName];
};
obs.getComplete = function () {
return obsItems;
};
obs.addComplete = function (itemsArg) {
obsItems = plugins._.assign(obsItems, itemsArg);
return obsItems;
};
return obs;
}
SmartenvObjectStorage.init = init;
})(SmartenvObjectStorage || (SmartenvObjectStorage = {}));
//# sourceMappingURL=smartenv.objectstorage.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"smartenv.objectstorage.js","sourceRoot":"","sources":["smartenv.objectstorage.ts"],"names":["SmartenvObjectStorage","SmartenvObjectStorage.init"],"mappings":"AAAA,iCAAiC;AACjC,IAAO,qBAAqB,CAwB3B;AAxBD,WAAO,qBAAqB,EAAC,CAAC;IAC1BA;QACIC,IAAIA,GAAGA,GAAOA,EAAEA,CAACA;QACjBA,IAAIA,QAAQA,GAAOA,EAAEA,CAACA;QACtBA,GAAGA,CAACA,OAAOA,GAAGA,UAASA,SAASA,EAACA,SAAuBA;YAAvB,yBAAuB,GAAvB,uBAAuB;YACpD,EAAE,CAAC,CAAC,SAAS,IAAI,WAAW,CAAC,CAAA,CAAC;gBAC1B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;gBAClD,MAAM,CAAC;YACX,CAAC;YACD,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;QACpC,CAAC,CAACA;QACFA,GAAGA,CAACA,OAAOA,GAAGA,UAASA,OAAOA;YAC1B,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAACA;QACFA,GAAGA,CAACA,WAAWA,GAAGA;YACd,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC,CAAAA;QAEDA,GAAGA,CAACA,WAAWA,GAAGA,UAASA,QAAQA;YAC/B,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAC,QAAQ,CAAC,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC,CAACA;QACFA,MAAMA,CAACA,GAAGA,CAACA;IACfA,CAACA;IAtBeD,0BAAIA,OAsBnBA,CAAAA;AACLA,CAACA,EAxBM,qBAAqB,KAArB,qBAAqB,QAwB3B"}

View File

@ -1,26 +0,0 @@
/// <reference path="index.ts" />
module SmartenvObjectStorage {
export function init() {
var obs:any = {};
var obsItems:any = {};
obs.addItem = function(objectArg,paramName = "undefined") {
if (paramName == "undefined"){
plugins.beautylog.error("paramName is undefined");
return;
}
obsItems[paramName] = objectArg;
};
obs.getItem = function(keyName) {
return obsItems[keyName];
};
obs.getComplete = function () {
return obsItems;
}
obs.addComplete = function(itemsArg) {
obsItems = plugins._.assign(obsItems,itemsArg);
return obsItems;
};
return obs;
}
}

3
ts/smartenv.plugins.ts Normal file
View File

@ -0,0 +1,3 @@
import * as smartpromise from '@push.rocks/smartpromise';
export { smartpromise };

View File

@ -1,15 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
var smartenv = require("./index.js");
var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module");
smartenv.printEnv();
beautylog.info("Now testing the smartenv module");
smartenv.obs.addItem({ key1: "Peter" }, "docit");
smartenv.printEnv();
beautylog.log(smartenv.obs.getItem("docit").key1);
beautylog.log(smartenv.obs.getItem("docit").key1);
var key2 = "hello";
smartenv.obs.getItem("docit").key2 = key2;
beautylog.log(smartenv.obs.getItem("docit").key2);
beautylog.success("Success!");
//# sourceMappingURL=test.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACrC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAClD,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpB,SAAS,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAClD,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,OAAO,CAAC,CAAC;AAC7C,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAClD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAElD,IAAI,IAAI,GAAG,OAAO,CAAC;AACnB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;AAC1C,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAElD,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}

View File

@ -1,16 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
var smartenv = require("./index.js");
var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module");
smartenv.printEnv();
beautylog.info("Now testing the smartenv module");
smartenv.obs.addItem({key1:"Peter"},"docit");
smartenv.printEnv();
beautylog.log(smartenv.obs.getItem("docit").key1);
beautylog.log(smartenv.obs.getItem("docit").key1);
var key2 = "hello";
smartenv.obs.getItem("docit").key2 = key2;
beautylog.log(smartenv.obs.getItem("docit").key2);
beautylog.success("Success!");

View File

@ -1,12 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
}
}
}

File diff suppressed because it is too large Load Diff

1
ts/typings/tsd.d.ts vendored
View File

@ -1 +0,0 @@
/// <reference path="node/node.d.ts" />

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}