TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sugar: A JavaScript library for working with native objects

2 pointsby evandrixalmost 11 years ago

2 comments

secoifalmost 11 years ago
This tool is absolutely amazing and a great idea… but has a big caveat: you can't sandbox it because it extends prototypes, so unfortunately it's entirely 100% unusable in node because it breaks module encapsulation. Node allows multiple versions of the same package to exist simultaneously, so if one package depends on sugar@1.0.0 and another on sugar@1.5.0, the version that is used to extend the prototypes is entirely determined at run-time – and could even change at run-time.
评论 #8106747 未加载
nobulletalmost 11 years ago
Looks similar to Prototype library. But the same mistake: extending the prototype :)
评论 #8106749 未加载