3 ms·
I don't know how "clickbait" that title can be when it is, in fact, longer than the line of code in question: declare function isPromise<T, S>(obj: Promise
by ajross 7y ago
I don't know how "clickbait" that title can be when it is, in fact, longer than the line of code in question:
declare function isPromise<T, S>(obj: Promise<T> | S): obj is Promise<T>;
This is, indeed, the only line of exported code in the entire package.
I genuinely don't understand the NPM world.
- jakear 7y agoThat's just the type definition. Think of it like the .h if you're into that sort of thing.
- redmorphium 7y agoMe neither. I can't wait for Deno 1.0 next month. https://deno.land/ https://deno.land/
- stickac 7y agoHow exactly will the new runtime fix the habit of Javascript developers to pull-in millions of dependencies?
- freeqaz 7y agoWhat is this exactly? The website is a bit unclear.
- jpangs88 7y agoI was wrong about what this was I have edited this comment
- eropple 7y agoWhy would a Rust wrapper around the C++ project that is V8, which implements a garbage-collected programming language and environment, "use less ram" just by virtue of some parts of it being written in Rust?
- deleted 7y ago[deleted]
- frank2 7y agoDeno is much like node (uses the V8 engine, does not require a browser) and was created by the man who created node.
- jpangs88 7y agoMakes me look forward to this more https://romejs.dev/ https://romejs.dev/ since one of the ideas is that it will have no third party dependencies...
- hn_throwaway_99 7y ago> I genuinely don't understand the NPM world. You're right, you don't. What you posted is just the function declaration, not the implementation.
- deleted 7y ago[deleted]
- hughes 7y agoI think it reflects how the evolution of the JS ecosystem strongly resembles natural evolution. This package is now a vestigial organ, but there was a time when it served a useful purpose. Other packages formed connective tissue to this package, and since those package may still be useful, this one has stuck around.
- deleted 7y ago[deleted]
- svnpenn 7y agoNPM is the answer to the question: what would happen if everyone refused to use any idioms ever, and instead replace them all with packages? God help you, if you import a JavaScript (or Rust) package today. Lest you fall in a gaping chasm of endless cascading dependencies.
- linkdd 7y agoIt's not NPM's fault, it's developer's fault. I would never in my right mind publish a one-line package, Python, Javascript, whatever. And I would never add a one line package as dependency