TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Stringify.org – encode any text as a JavaScript string

3 点作者 stevekrouse5 个月前
Do you ever want to embed a super long string in JavaScript, and find yourself escaping quotes or interpolations by hand?<p>I find this comes up a lot, particularly when you&#x27;re doing code generation stuff, because you need to have examples of code for the LLM, and that code often has strings embedded inside it. For example, take a look at the code properties in this JSON array[1].<p>Introducing stringify.org, the world&#x27;s only correct-by-definition JavaScript string encoder website. It uses JSON.stringify, which is the only guaranteed method to output a string that is also valid JavaScript. It&#x27;s in the spec.<p>[1] - <a href="https:&#x2F;&#x2F;www.val.town&#x2F;v&#x2F;stevekrouse&#x2F;cerebras_coder_prompts" rel="nofollow">https:&#x2F;&#x2F;www.val.town&#x2F;v&#x2F;stevekrouse&#x2F;cerebras_coder_prompts</a>

暂无评论

暂无评论