@mixd-id/web-scaffold 0.1.2301231362 → 0.1.2301231363

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.2301231362",
4
+ "version": "0.1.2301231363",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -2,7 +2,6 @@ const md5 = require("md5");
2
2
  const fs = require("fs");
3
3
 
4
4
 
5
-
6
5
  const ceil = (num, precision = 0) => {
7
6
  var p = Math.pow(10, precision)
8
7
  var n = (num * p) * (1 + Number.EPSILON)
@@ -159,6 +158,14 @@ const writeStorage = (path, content, append = false) => {
159
158
  }
160
159
  }
161
160
 
161
+ const bufferToStream = (buffer) => {
162
+ const { Duplex } = require('stream')
163
+ let stream = new Duplex()
164
+ stream.push(buffer)
165
+ stream.push(null)
166
+ return stream
167
+ }
168
+
162
169
 
163
170
  module.exports = {
164
171
  ceil,
@@ -173,5 +180,6 @@ module.exports = {
173
180
  sleep,
174
181
  strSlug,
175
182
  strVars,
176
- writeStorage
183
+ writeStorage,
184
+ bufferToStream
177
185
  }