![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A small http(s) GET library with redirects, retries, reconnects, concatenating or streaming, and no dependencies. This keeps filesize small for potential browser use.
Concatenates a response
const miniget = require('miniget');
miniget('http://mywebsite.com', (err, res, body) => {
console.log('webpage contents: ', body);
});
// with await
let body = await miniget('http://yourwebsite.com').text();
Request can be streamed right away
miniget('http://api.mywebsite.com/v1/messages.json')
.pipe(someWritableStream());
Makes a GET request. url
can be a string or a URL
object. options
can have any properties from the http.request()
function, in addition to
maxRedirects
- Default is 10
.maxRetries
- Number of times to retry the request if there is a 500 or connection error. Default is 2
.maxReconnects
- During a big download, if there is a disconnect, miniget can try to reconnect and continue the download where it left off. Default is 0
.backoff
- An object with inc
and max
used to calculate how long to wait to retry a request. Default is { inc: 100, max: 10000 }
.highWaterMark
- Amount of data to buffer when in stream mode.transform
- Use this to add additional features. Called with the object that http.get()
or https.get()
would be called with. Must return a transformed object.acceptEncoding
- An object with encoding name as the key, and the value as a function that returns a decoding stream.
acceptEncoding: { gzip: () => require('zlip').createGunzip(stream) }
Given encodings will be added to the Accept-Encoding
header, and the response will be decoded if the server responds with encoded content.Defaults are held in miniget.defaultOptions
and can be adjusted globally.
Miniget returns a readable stream, errors will then be emitted on the stream. Returned stream has additional methods added, and can emit the following events.
Destroys the request.
Set to true
after Stream#destroy()
has been called.
Returns a promise that resolves to the concatenated contents of the response.
let body = await miniget('http://yourwebsite.com').text();
string
- URL redirected to.Emitted when the request was redirected with a redirection status code.
number
- Number of retry.Error
- Request or status code error.Emitted when the request fails, or the response has a status code >= 500.
number
- Number of reconnect.Error
- Request or response error.Emitted when the request or response fails after download has started.
http.ClientRequest
- Request.Emitted when a video request is made, including after any redirects, retries, and reconnects.
http.ServerResponse
- Response.Emitted when a video response has been found and has started downloading, including after any successful reconnects.
Any events emitted from the request or response objects will be forwarded to the miniget stream.
npm install miniget
Tests are written with mocha
npm test
FAQs
A small HTTP(S) GET request library, with redirects and streaming.
The npm package miniget receives a total of 132,540 weekly downloads. As such, miniget popularity was classified as popular.
We found that miniget demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.