Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubensworks/streamify-array.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.1
Choose a base ref
...
head repository: rubensworks/streamify-array.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.0
Choose a head ref
  • 7 commits
  • 8 files changed
  • 6 contributors

Commits on Feb 16, 2018

  1. correct data variable in README example

    Amisha Singla authored and rubensworks committed Feb 16, 2018
    Copy the full SHA
    2b76db7 View commit details

Commits on Aug 16, 2018

  1. Copy the full SHA
    4c5b4d2 View commit details
  2. 1.0.1

    rubensworks committed Aug 16, 2018
    Copy the full SHA
    3db80c9 View commit details

Commits on Mar 16, 2020

  1. Configure Renovate (#5)

    * Add renovate.json
    
    * Update renovate.json
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Ruben Taelman <rubensworks@users.noreply.github.com>
    3 people authored Mar 16, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dab58ea View commit details

Commits on Feb 18, 2025

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3414efb View commit details
  2. Copy the full SHA
    7899d17 View commit details
  3. v2.0.0

    rubensworks committed Feb 18, 2025
    Copy the full SHA
    151148d View commit details
Showing with 88 additions and 16 deletions.
  1. +5 −0 .gitignore
  2. +2 −2 README.md
  3. +0 −11 index.js
  4. +11 −0 index.ts
  5. +15 −3 package.json
  6. +5 −0 renovate.json
  7. +30 −0 tsconfig.json
  8. +20 −0 yarn.lock
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.idea
*.d.ts
*.js
*.js.map
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ This is a very simple zero-dependency implementation.
## Usage

```javascript
const streamifyArray = require('streamify-array');
import { streamifyArray } from 'streamify-array';

let stream = streamifyArray([ 'a', 'b', 'c' ]);
stream.on('data', (e) => console.log('Data: ' + d));
stream.on('data', (d) => console.log('Data: ' + d));
stream.on('end', () => console.log('Done!'))
```

11 changes: 0 additions & 11 deletions index.js

This file was deleted.

11 changes: 11 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {Readable} from "stream";

export function streamifyArray(array: unknown[]) {
const readable = new Readable({objectMode: true});
readable._read = function (size: number) {
for (let i = 0; i < size; i++) {
readable.push(array.shift() ?? null);
}
};
return readable;
}
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "streamify-array",
"version": "1.0.0",
"version": "2.0.0",
"description": "Converts an array into a Node readable stream",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
},
"repository": {
"type": "git",
@@ -20,5 +21,16 @@
"bugs": {
"url": "https://github.com/rubensworks/streamify-array.js/issues"
},
"homepage": "https://github.com/rubensworks/streamify-array.js#readme"
"typings": "index",
"files": [
"index.d.ts",
"index.js",
"index.js.map"
],
"homepage": "https://github.com/rubensworks/streamify-array.js#readme",
"devDependencies": {
"@types/node": "^22.13.4",
"typescript": "^5.7.3"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
5 changes: 5 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"github>rubensworks/renovate-presets:js"
]
}
30 changes: 30 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"lib": [
"es2020",
"es2021",
"dom"
],
"target": "es2020",
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true,
"inlineSources": true,
"declaration": true,
"resolveJsonModule": true,
"downlevelIteration": true,

"strict": true,
"strictFunctionTypes": false,
"strictPropertyInitialization": false
},
"include": [
"index.ts",
"lib/**/*"
],
"exclude": [
"**/node_modules",
]
}
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/node@^22.13.4":
version "22.13.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.4.tgz#3fe454d77cd4a2d73c214008b3e331bfaaf5038a"
integrity sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg==
dependencies:
undici-types "~6.20.0"

typescript@^5.7.3:
version "5.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==

undici-types@~6.20.0:
version "6.20.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433"
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==