Gathering detailed insights and metrics for seroval-plugins
Gathering detailed insights and metrics for seroval-plugins
Gathering detailed insights and metrics for seroval-plugins
Gathering detailed insights and metrics for seroval-plugins
npm install seroval-plugins
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
84.5
Quality
84.8
Maintenance
100
Vulnerability
100
License
TypeScript (95.56%)
HTML (3.97%)
JavaScript (0.47%)
Total Downloads
13,587,767
Last Day
27,953
Last Week
459,471
Last Month
1,839,911
Last Year
10,902,032
MIT License
604 Stars
898 Commits
8 Forks
4 Watchers
2 Branches
5 Contributors
Updated on Jul 03, 2025
Latest Version
1.3.2
Package Id
seroval-plugins@1.3.2
Unpacked Size
185.66 kB
Size
30.92 kB
File Count
54
NPM Version
lerna/8.2.2/node@v20.11.1+arm64 (darwin)
Node Version
20.11.1
Published on
May 24, 2025
Cumulative downloads
Total Downloads
Last Day
-14.8%
27,953
Compared to previous day
Last Week
-2.2%
459,471
Compared to previous week
Last Month
24.7%
1,839,911
Compared to previous month
Last Year
305.9%
10,902,032
Compared to previous year
1
7
Stringify JS values
1npm install --save seroval
1yarn add seroval
1pnpm add seroval
1import { serialize } from 'seroval'; 2 3const object = { 4 number: [Math.random(), -0, NaN, Infinity, -Infinity], 5 string: ['hello world', '<script>Hello World</script>'], 6 boolean: [true, false], 7 null: null, 8 undefined: undefined, 9 bigint: 9007199254740991n, 10 array: [,,,], // holes 11 regexp: /[a-z0-9]+/i, 12 date: new Date(), 13 map: new Map([['hello', 'world']]), 14 set: new Set(['hello', 'world']), 15}; 16 17// self cyclic references 18// recursive objects 19object.self = object; 20// recursive arrays 21object.array.push(object.array); 22// recursive maps 23object.map.set('self', object.map); 24// recursive sets 25object.set.add(object.set); 26 27// mutual cyclic references 28object.array.push(object.map); 29object.map.set('mutual', object.set); 30object.set.add(object.array); 31 32const result = serialize(object); 33console.log(result);
Output (as a string):
1((h,j,k,m,o)=>(o={number:[0.5337763749243287,-0,0/0,1/0,-1/0],string:["hello world","\x3Cscript>Hello World\x3C/script>"],boolean:[!0,!1],null:null,undefined:void 0,bigint:9007199254740991n,array:h=[,,,,k=(j=[],new Map([["hello","world"],["mutual",m=new Set(["hello","world"])]]))],regexp:/[a-z0-9]+/i,date:new Date("2023-12-07T17:28:57.909Z"),map:k,set:m},h[3]=h,k.set("self",k),m.add(m).add(h),o.self=o,o))() 2 3// Formatted for readability 4((h, j, k, m, o) => ( 5 (o = { 6 number: [0.5337763749243287, -0, 0 / 0, 1 / 0, -1 / 0], 7 string: ["hello world", "\x3Cscript>Hello World\x3C/script>"], 8 boolean: [!0, !1], 9 null: null, 10 undefined: void 0, 11 bigint: 9007199254740991n, 12 array: (h = [ 13 , 14 , 15 , 16 , 17 (k = 18 ((j = []), 19 new Map([ 20 ["hello", "world"], 21 ["mutual", (m = new Set(["hello", "world"]))], 22 ]))), 23 ]), 24 regexp: /[a-z0-9]+/i, 25 date: new Date("2023-12-07T17:28:57.909Z"), 26 map: k, 27 set: m, 28 }), 29 (h[3] = h), 30 k.set("self", k), 31 m.add(m).add(h), 32 (o.self = o), 33 o 34))();
MIT © lxsmnsyc
No vulnerabilities found.
No security vulnerabilities found.