
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
nuxt-content-narrator
Advanced tools
A Nuxt layer that provides text-to-speech narration capabilities for Nuxt Content pages.
A Nuxt layer that provides text-to-speech narration capabilities for Nuxt Content pages.
Watch the video with audio on YouTube
npm i nuxt-content-narrator
// nuxt.config.ts
extends: ["nuxt-content-narrator"],
Get your ElevanLabs API key and set as an environment variable
NUXT_ELEVENLABS_API_KEY=sk_xxx
Add the NcNarrator components to your content pages
<script setup lang="ts">
const route = useRoute();
const { data: story } = await useAsyncData(() =>
queryCollection("stories")
.path(route.path.toString() ?? "")
.first()
);
</script>
<template>
<article class="prose prose-lg mx-auto">
<NcNarratorService
v-if="story"
:collection-item="story"
voiceId="FGY2WhTYpPnrIDTdsKH5"
>
<NcNarratorPlayer progressClass="bg-gray-900" />
<NcNarratorDevTools />
<NcNarratorFollowAlongRenderer
highlightClass="bg-gray-900"
highlightTextClass="text-white"
/>
</NcNarratorService>
</article>
</template>
The core service component that manages the text-to-speech functionality and state.
Props:
collectionItem
: (Required) A Nuxt Content page collection item that includes the rawbody
property (read more about rawbody here)voiceId
: (Optional) The ID of the ElevenLabs voice to use for narration (Visit https://elevenlabs.io/app/voice-lab to browse all Elevan labs voices, click "View" button, and get the voiceId from the url )Features:
A customizable audio player component that provides playback controls.
Props:
progressClass
: (Optional) CSS class for the progress bar (default: "bg-slate-900")Features:
Customize with Default Slot
<NcNarratorPlayer
v-slot="{
play, // function to play the audio
pause, // function to pause the audio
toggle, // function to toggle the audio
playing, // boolean to check if the audio is playing
currentTime, // number to get the current time of the audio
duration, // number to get the duration of the audio
percentComplete // number to get the percent complete of the audio
}"
>
<!-- Your custom player UI -->
</NcNarratorPlayer>
An optional component that renders text with synchronized highlighting during audio playback. If you don't need synchronized highlighting, you can use the regular Nuxt Content component.
Props:
highlightClass
: (Optional) CSS class for the highlight background (default: "bg-slate-900")highlightTextClass
: (Optional) CSS class for the highlighted text (default: "text-white")Features:
Development tools component for audio generation in development.
<!--
Only visible in development mode
Displays a button to generate audio for the current page
-->
<NcNarratorDevTools />
NcNarratorService
:<template>
<NcNarratorService :collection-item="page">
<!-- Your content and other narrator components -->
</NcNarratorService>
</template>
<template>
<NcNarratorService :collection-item="page">
<NcNarratorPlayer />
<!-- Your content -->
</NcNarratorService>
</template>
<template>
<NcNarratorService :collection-item="page">
<NcNarratorPlayer />
<NcNarratorFollowAlongRenderer />
<!--
or if you only need the audio and not the highlighting use the regular
Nuxt Content <ContentRenderer/> copmonent
-->
</NcNarratorService>
</template>
The components come with minimal default styling and can be customized using the following:
To help contribute to the project, you can clone the repo and install the layer by pointing your extends
to the local path from another Nuxt project.
// nuxt.config.ts
extends: ["../../nuxt-content-narrator"],
Just like your content, the audio is stored in the github repo. It is generated with the button in the NcNarratorDevTools
component and stored in the audio
folder.
FAQs
A Nuxt layer that provides text-to-speech narration capabilities for Nuxt Content pages.
We found that nuxt-content-narrator demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.