liviamedeiros / poteto Goto Github PK
View Code? Open in Web Editor NEWpoteto is HTTP-alike fetch for FILE protocol, e.g. fetch('file:///usr/bin/node')
Home Page: https://www.npmjs.com/package/poteto
License: GNU General Public License v3.0
poteto is HTTP-alike fetch for FILE protocol, e.g. fetch('file:///usr/bin/node')
Home Page: https://www.npmjs.com/package/poteto
License: GNU General Public License v3.0
For initial compatibility with Deno, the following incompatibilities with Node.js API have to be solved:
fs.writeFile(_, body, _)
doesn't accept ReadableStream
as body
fd.write(chunk, { length, position }
signature is not supportedfilehandle[Symbol.asyncDispose]
is not definedRequest
instance properties, integrity
in particular, are ignored by constructor and fetch
(which is security issue tbh)ReadableStream.from()
is not implemented (tbf it's too fresh)fd.read()
signature is... I don't get it rnfs.fileAppend(_, body, _)
doesn't accept ReadableStream
as body
eitherfd.readableWebStream()
is not supportedThe Range
header has good potential for reading local files, but it's limited (only bytes
is supported) and multipart/byteranges
response format is clunky.
Perhaps it would make sense to deviate from standard here, providing a single response with all chunks concatenated, and introducing more units (maybe lines
?).
Some HTTP mechanisms that may be added:
Accept
/ Content-Type
Accept-Encoding
/ Content-Encoding
Accept-Language
/ Content-Language
Accept-Ranges
/ Range
/ Content-Range
multipart/byteranges
are absurd to implement here.Authorization
Cache-Control
Connection
/ Keep-Alive
TimeoutError
and closing file descriptors if the response body state happens to be stalling. Fun, but not very useful and probably not very robust.Expect
/ request Content-Length
100
is not the most convenient thing in HTTP.Cookie
/ Set-Cookie
Host
/ Origin
/ Referer
If-Match
/ If-None-Match
/ ETag
If-Modified-Since
/ If-Unmodified-Since
/ Last-Modified
Downlink
, but usability is questionable even if it was simple to implement.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.