@gjsify/console 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -40
- package/lib/cjs/index.js +36 -0
- package/lib/esm/index.js +6 -0
- package/package.json +40 -53
- package/src/index.spec.ts +10 -0
- package/src/index.ts +4 -0
- package/src/test.mts +6 -0
- package/test.gjs.mjs +35571 -0
- package/test.gjs.mjs.meta.json +1 -0
- package/test.node.mjs +308 -0
- package/tsconfig.json +19 -0
- package/tsconfig.types.json +8 -0
- package/.testem.json +0 -14
- package/.travis.yml +0 -11
- package/CHANGELOG.md +0 -10
- package/LICENCE +0 -19
- package/index.js +0 -108
- package/test/index.js +0 -67
- package/test/static/index.html +0 -12
- package/test/static/test-adapter.js +0 -53
package/README.md
CHANGED
|
@@ -1,42 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gjsify/console
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Node.js console module for Gjs
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
You usually do not have to install `console-browserify` yourself! If your code runs in Node.js, `console` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `console-browserify` module when you do `require('console')`.
|
|
8
|
-
|
|
9
|
-
But if none of those apply, with npm do:
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
npm install console-browserify
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
var console = require("console")
|
|
19
|
-
// Or when manually using console-browserify directly:
|
|
20
|
-
// var console = require("console-browserify")
|
|
21
|
-
|
|
22
|
-
console.log("hello world!")
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## API
|
|
26
|
-
|
|
27
|
-
See the [Node.js Console docs](https://nodejs.org/api/console.html). `console-browserify` does not support creating new `Console` instances and does not support the Inspector-only methods.
|
|
28
|
-
|
|
29
|
-
## Contributing
|
|
30
|
-
|
|
31
|
-
PRs are very welcome! The main way to contribute to `console-browserify` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
|
|
32
|
-
This module intends to provide exactly the same API as Node.js, so features that are not available in the core `console` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.
|
|
33
|
-
|
|
34
|
-
If there is a difference in behaviour between Node.js's `console` module and this module, please open an issue!
|
|
35
|
-
|
|
36
|
-
## Contributors
|
|
37
|
-
|
|
38
|
-
- Raynos
|
|
39
|
-
|
|
40
|
-
## License
|
|
41
|
-
|
|
42
|
-
[MIT](./LICENSE)
|
|
5
|
+
## Inspirations and credits
|
|
6
|
+
- https://github.com/denoland/deno/tree/main/ext/console
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => src_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("@gjsify/deno_std/node/console"), module.exports);
|
|
35
|
+
var import_console = __toESM(require("@gjsify/deno_std/node/console"), 1);
|
|
36
|
+
var src_default = import_console.default;
|
package/lib/esm/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,60 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/console",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Node.js console module for Gjs",
|
|
5
|
+
"main": "lib/cjs/index.js",
|
|
6
|
+
"module": "lib/esm/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/types/index.d.ts",
|
|
12
|
+
"default": "./lib/esm/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/types/index.d.ts",
|
|
16
|
+
"default": "./lib/cjs/index.js"
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
|
-
],
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/browserify/console-browserify/issues",
|
|
17
|
-
"email": "raynos2@gmail.com"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"jsonify": "0.0.0",
|
|
21
|
-
"run-browser": "^1.3.0",
|
|
22
|
-
"tap-dot": "^0.2.1",
|
|
23
|
-
"tap-spec": "^0.1.8",
|
|
24
|
-
"tape": "^2.12.3"
|
|
25
19
|
},
|
|
26
|
-
"licenses": [
|
|
27
|
-
{
|
|
28
|
-
"type": "MIT",
|
|
29
|
-
"url": "http://github.com/browserify/console-browserify/raw/master/LICENSE"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
20
|
"scripts": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"build": "
|
|
41
|
-
"
|
|
21
|
+
"clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo || exit 0",
|
|
22
|
+
"print:name": "echo '@gjsify/console'",
|
|
23
|
+
"build": "yarn print:name && yarn build:gjsify",
|
|
24
|
+
"build:gjsify": "gjsify build --library 'src/**/*.{ts,js}' --exclude 'src/**/*.spec.{mts,ts}' 'src/test.{mts,ts}'",
|
|
25
|
+
"build:types": "tsc --project tsconfig.types.json || exit 0",
|
|
26
|
+
"build:test": "yarn build:test:gjs && yarn build:test:node",
|
|
27
|
+
"build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
|
|
28
|
+
"build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
|
|
29
|
+
"test": "yarn print:name && yarn build:gjsify && yarn build:test && yarn test:node && yarn test:gjs",
|
|
30
|
+
"test:gjs": "gjs -m test.gjs.mjs",
|
|
31
|
+
"test:node": "node test.node.mjs"
|
|
42
32
|
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"safari/5.1..latest",
|
|
54
|
-
"ipad/6.0..latest",
|
|
55
|
-
"iphone/6.0..latest",
|
|
56
|
-
"android-browser/4.2..latest"
|
|
57
|
-
]
|
|
33
|
+
"keywords": [
|
|
34
|
+
"gjs",
|
|
35
|
+
"node",
|
|
36
|
+
"console"
|
|
37
|
+
],
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@gjsify/cli": "^0.0.2",
|
|
40
|
+
"@gjsify/unit": "^0.0.2",
|
|
41
|
+
"@types/node": "^20.3.1",
|
|
42
|
+
"typescript": "^5.1.3"
|
|
58
43
|
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@gjsify/deno_std": "^0.0.2"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, it, expect } from '@gjsify/unit';
|
|
2
|
+
import console from "console"
|
|
3
|
+
|
|
4
|
+
export default async () => {
|
|
5
|
+
await describe('Default import', async () => {
|
|
6
|
+
await it('should be an object', async () => {
|
|
7
|
+
expect(console instanceof Object).toBeTruthy();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
}
|
package/src/index.ts
ADDED