From c254b4ccec47b549deddc34c5b7f0ba090c543b6 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Mon, 24 Nov 2025 08:49:19 -0500 Subject: [PATCH 1/2] Add warning about using this for worker threads --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6523ba..5cd6bdf 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Serialize JavaScript to a _superset_ of JSON that includes regular expressions, The code in this package began its life as an internal module to [express-state][]. To expand its usefulness, it now lives as `serialize-javascript` — an independent package on npm. -You're probably wondering: **What about `JSON.stringify()`!?** We've found that sometimes we need to serialize JavaScript **functions**, **regexps**, **dates**, **sets** or **maps**. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. But this module is also great for communicating between node processes. +You're probably wondering: **What about `JSON.stringify()`!?** We've found that sometimes we need to serialize JavaScript **functions**, **regexps**, **dates**, **sets** or **maps**. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. The string returned from this package's single export function is literal JavaScript which can be saved to a `.js` file, or be embedded into an HTML document by making the content of a `