open-index/open-npm huggingface dataset:
npm package: @rafapaezbas/mp3-duration
Description: Get the duration of an MP3 file
Author: Han de Boer
Latest version: 1.2.0

# mp3-duration ![Travis-Build](https://travis-ci.org/ddsol/mp3-duration.svg?branch=master)

> Calculate duration of an MP3 in seconds


## Install

```
$ npm install --save mp3-duration
```

## Usage

```javascript
var mp3Duration = require('mp3-duration');

mp3Duration('file.mp3', function (err, duration) {
  if (err) return console.log(err.message);
  console.log('Your file is ' + duration + ' seconds long');
});
```

## API

## mp3Duration(filePathOrBuffer [, cbrEstimate] [, callback])

### filePathOrBuffer

Type: `string` | `Buffer`

Path to the file or a buffer with the file's contents

### cbrEstimate

Defaults to `false`. When set to `true`, will estimate the length of a
constant-bitrate mp3. This speeds up the calculation a lot but isn't
guaranteed to be accurate.

### callback(error, duration)

Type: `function`

Callback to be called once duration is calculated. It's also possible to
instead use the returned `Promise`. `duration` is the duration of the
mp3 in `seconds` (including fractional seconds).

### Return value

`mp3Duration` returns a Promise that resolves to the duration of the mp3 in `seconds` or rejects with some error.

## License

MIT © Han de Boer
npm package: @rafaremo/gatsby-theme-shopify-starter
Description: Shopify starter theme to easily connect a Shopify store to your gatsby site and develope a custome store experience. It includes a custome hook to acces helper functions to add, update and remove objects from your shopify checkout.
Latest version: 1.1.2

## Description

Shopify starter theme to easily connect a Shopify store to your gatsby site and develope a custome store experience. It includes a custome hook to acces helper functions to add, update and remove objects from your shopify checkout.

## How to install

`npm i -S @rafaremo/gatsby-theme-shopify-starter`

or

`yarn add @rafaremo/gatsby-theme-shopify-starter`

After install open your `gatsby-config.js` file and add the theme as follows.

```js
module.exports = {
  plugins: [
    {
      `@rafaremo/gatsby-theme-shopify-starter`,
      options: {
        shopName: "<your-store>.myshopify.com",
        accessToken: "STOREFRONT ACCESS TOKEN",
        basePath: "/",
        productBasePath: "/product", //Product base path
        collectionBasePath: "/collection" //Collection base path
      }
    }
  ],
}
```

Run your development environment

```sh
gatsby develop
```

## Examples of usage

To start building your Gatsby Storefront you just need too [shadow](https://egghead.io/lessons/gatsby-use-component-shadowing-to-override-gatsby-theme-components) theme template pages and make usage of the custom cart hook to update the shopify checkout.

To use the custom hook import the hook from the theme package

```js
import { useCart } from '@rafaremo/gatsby-theme-shopify-starter';
```

Then use the hook to acces the different utility functions to update the shopify checkout

```js
const { store, addVariantToCart, removeLineItem, updateLineItem } = useCart();
```

When you are ready to send your client to the Shopify checkout use the store object from the `useCart` hook to get the checkout URL and redirect your client to that URL.

```js
window.open(store.checkout.webUrl);
```