npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-strobe

v1.0.2

Published

Customizable strobe for react native

Readme

React Native Strobe

Customizable strobe for react native.

Gif_1 Gif_2

Prerequisites

If you want to use this library, you also need to install:

react-native-linear-gradient

Installing

Using npm:

npm install react-native-strobe

Using yarn:

yarn add react-native-strobe

Usage example

import { Strobe } from "react-native-strobe";

<Strobe
  songDuration={musicData.durationSec}
  waveform={currentSongWaveform}
  samplesInSec={wfSamplesPS}
  closeStrobe={() => turnStrobe(false)} 
  buttonPosition={'bottomCenter'}
  syncInterval={2000}
  {...{paused, progress}}
/>

Props

liteMode: boolean;

render strobe as a small block

paused: boolean;

is the track paused at the moment

buttonPosition?: 'bottomCenter' | 'bottomRight';

Position of "close" button

defaultText?: string;

Placeholder

defaultColor1Index?: number;

Default index (in strobeColorsArray) of first strobe color

defaultColor2Index?: number;

Default index (in strobeColorsArray) of second strobe color

maxSampleValue?: number;

128 by default

strobeColorsArray?: string[];

Your's array of colors for strobe

syncInterval: number;

interval (in milliseconds) between updates of the progress prop

useGradient?: boolean;

Use gradient feautures

progress: number;

(In seconds) - current playing time

songDuration: number;

(In seconds) - track duration

waveform?: Waveform;

type Waveform = {
  bits: number;
  channels: number;
  data: number[];
  length: number;
  sample_rate: number;
  samples_per_pixel: number;
}
samplesInSec: number;

Use this formula to calculate samplesInSec number:
samplesInSec = Math.round(waveform.length * 2 / durationSec)
waveform - samples array
durationSec - duration of the track
updatesInSecond?: number;

5 by default

showCloseButton?: boolean;

default is true

closeStrobe: () => void;

callback when close button is pressed

customLiteContainerStyle?: ViewStyle;

Override LiteContainerStyle

customContainerStyle?: ViewStyle;

Override ContainerStyle

customBlockStyle?: ViewStyle;

Override BlockStyle

customTextContainerStyle?: ViewStyle;

Override TextContainerStyle

customStrobeTextStyle?: ViewStyle;

Override StrobeTextStyle

How to form wave data (Node js)

const { exec } = require('child_process')
const path = require('path')
//project path + folder with name 'music'
const uploadPath = path.resolve(process.cwd() + '/' + 'music')

const getWaveform = async(filename) => {
    const fullFileName = uploadPath + '/' + filename
    return new Promise((resolve,reject) => {
        const outputFullFileName = fullFileName.replace(/\.mp3/ig, '.json')
        let commandLine = 'audiowaveform -i'
        commandLine += ' "' + fullFileName + '" '
        commandLine += '-o'
        commandLine += ' "' + outputFullFileName + '" '
        commandLine += '-z 2048 -b 8'
        exec(commandLine, (e, stdout, stderr) => {
            if(e) reject(e)
            resolve( require( outputFullFileName ) )       
        })
    })
}

//Put some.mp3 to folder 'music' in your project folder
getWaveform('some.mp3')
.catch(e => console.log(e))
//Output of this function is json waveform data, you can write his to db or use whatever you like
.then(data => console.log(data))

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details