![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A component for tailing a log file from a server that consumes the Range header
Library for requesting the last N bytes of a log from any server that properly consumes the Range header and responds accordingly. This library includes polling and uses events to notify when data is available or when an error occurs.
npm install --save logtail
import LogTail from '/node_modules/logtail/logtail.js';
const tail = new LogTail({
url: '/url/to/file',
loadBytes: 30 * 1024, /* 30KB */
pollInterval: 1000, /* 1s */
pause: false,
debug: false,
});
tail.on(UnexpectedServerResponseErrorEvent.name, evt => {
console.log(evt.detail.status, evt.detail.statusText);
});
tail.on(DataAppendedEvent.name, evt => {
// data that's been appended to the file
console.log(evt.detail);
});
tail.on(FetchErrorEvent.name, evt => {
// the error that was thrown when the fetch failed
console.log(evt.detail);
});
tail.on(MissingContentRangeErrorEvent.name, evt => {
// an array of headers that were sent in the response (for debugging)
evt.detail.forEach(header => console.log(header.name, header.value));
});
tail.on(Non206ResponseErrorEvent.name, evt => {
console.log(evt.detail.status, evt.detail.statusText);
});
tail.on(ServerResponseTooLongErrorEvent.name, evt => {
console.log(evt.detail.length, evt.detail.responseText);
});
// or
tail.on('error', error => { ... });
const tail = new LogTail({
url: <string>,
loadBytes: <number>, /* Default: 30KB */
pollInterval: <number>, /* Default: 1s */
pause: false,
debug: false,
});
The constructor takes an object of properties that configures the logger. The only required option is 'url' which points to the file to tail. The 'debug' option is mostly for development, but can be set to 'true' to see log output from this library
Adds the callback
as a listener to event
. If ctx
is a not-null or not-undefined object, the callback will be executed within that context; e.g.
callback.apply(ctx)
The callback
will recieve data about the event (usually just a single Event or Error object. See the method docs for more details)
Removes the callback
as a listener to event
. It returns true if successful, false otherwise.
Starts the poller. The poller can also be started by calling poll()
git clone https://github.com/stone-joe/logtail
cd logtail
npm install
npm test
npm start # starts the server for testing the script and viewing the logs
npm run docs # generates the documentation (served when npm start is called)
GNU GPL 3: http://www.gnu.org/licenses/
FAQs
A component for tailing a log file from a server that consumes the Range header
The npm package js-logtail receives a total of 4 weekly downloads. As such, js-logtail popularity was classified as not popular.
We found that js-logtail 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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.