@trenskow/stream-reader 0.1.21 → 0.2.0

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.
@@ -0,0 +1,48 @@
1
+ import globals from 'globals';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import js from '@eslint/js';
5
+ import { FlatCompat } from '@eslint/eslintrc';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const compat = new FlatCompat({
10
+ baseDirectory: __dirname,
11
+ recommendedConfig: js.configs.recommended,
12
+ allConfig: js.configs.all
13
+ });
14
+
15
+ export default [...compat.extends('eslint:recommended'), {
16
+ languageOptions: {
17
+ globals: {
18
+ ...globals.node,
19
+ ...globals.mocha,
20
+ ...globals.browser,
21
+ globalThis: false,
22
+ },
23
+
24
+ ecmaVersion: 'latest',
25
+ sourceType: 'module',
26
+ },
27
+
28
+ rules: {
29
+ indent: ['error', 'tab'],
30
+ 'linebreak-style': ['error', 'unix'],
31
+ quotes: ['error', 'single'],
32
+ semi: ['error', 'always'],
33
+
34
+ 'no-console': ['error', {
35
+ allow: ['warn', 'error', 'info'],
36
+ }],
37
+
38
+ 'no-unused-vars': ['error', {
39
+ argsIgnorePattern: '^_',
40
+ }],
41
+
42
+ 'no-empty': ['error', {
43
+ allowEmptyCatch: true,
44
+ }],
45
+
46
+ 'require-atomic-updates': 'off',
47
+ },
48
+ }];
package/index.js CHANGED
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- exports = module.exports = (stream, options = {}) => {
1
+ export default (stream, options = {}) => {
4
2
 
5
3
  return new Promise((resolve, reject) => {
6
4
 
package/package.json CHANGED
@@ -1,27 +1,31 @@
1
1
  {
2
- "name": "@trenskow/stream-reader",
3
- "version": "0.1.21",
4
- "description": "A simple promise to read the content of a stream in Node.js.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/trenskow/stream-reader.git"
12
- },
13
- "author": "Kristian Trenskow <trenskow@me.com>",
14
- "license": "BSD-2-Clause",
15
- "bugs": {
16
- "url": "https://github.com/trenskow/stream-reader/issues"
17
- },
18
- "keyword": [
19
- "stream",
20
- "read",
21
- "promise"
22
- ],
23
- "homepage": "https://github.com/trenskow/stream-reader#readme",
24
- "devDependencies": {
25
- "eslint": "^9.12.0"
26
- }
2
+ "name": "@trenskow/stream-reader",
3
+ "version": "0.2.0",
4
+ "description": "A simple promise to read the content of a stream in Node.js.",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/trenskow/stream-reader.git"
13
+ },
14
+ "author": "Kristian Trenskow <trenskow@me.com>",
15
+ "license": "BSD-2-Clause",
16
+ "bugs": {
17
+ "url": "https://github.com/trenskow/stream-reader/issues"
18
+ },
19
+ "keyword": [
20
+ "stream",
21
+ "read",
22
+ "promise"
23
+ ],
24
+ "homepage": "https://github.com/trenskow/stream-reader#readme",
25
+ "devDependencies": {
26
+ "@eslint/eslintrc": "^3.1.0",
27
+ "@eslint/js": "^9.13.0",
28
+ "eslint": "^9.13.0",
29
+ "globals": "^15.11.0"
30
+ }
27
31
  }
package/.eslintrc.js DELETED
@@ -1,53 +0,0 @@
1
- module.exports = {
2
- 'env': {
3
- 'es6': true,
4
- 'node': true,
5
- 'mocha': true,
6
- 'browser': true
7
- },
8
- 'globals': {
9
- 'globalThis': false
10
- },
11
- 'parserOptions': {
12
- 'ecmaVersion': 2017
13
- },
14
- 'extends': 'eslint:recommended',
15
- 'rules': {
16
- 'indent': [
17
- 'error',
18
- 'tab'
19
- ],
20
- 'linebreak-style': [
21
- 'error',
22
- 'unix'
23
- ],
24
- 'quotes': [
25
- 'error',
26
- 'single'
27
- ],
28
- 'semi': [
29
- 'error',
30
- 'always'
31
- ],
32
- 'no-console': [
33
- 'error', {
34
- 'allow': [
35
- 'warn',
36
- 'error',
37
- 'info'
38
- ]
39
- }
40
- ],
41
- 'no-unused-vars': [
42
- 'error', {
43
- 'argsIgnorePattern': '^_'
44
- }
45
- ],
46
- 'no-empty': [
47
- 'error', {
48
- 'allowEmptyCatch': true
49
- }
50
- ],
51
- 'require-atomic-updates': 'off'
52
- }
53
- };