open-index/open-npm huggingface dataset:
npm package: @smalllb/dumi2-demo
Description: A react library developed with dumi
Latest version: 0.0.1

# dumi2-demo

[![NPM version](https://img.shields.io/npm/v/dumi2-demo.svg?style=flat)](https://npmjs.org/package/dumi2-demo)
[![NPM downloads](http://img.shields.io/npm/dm/dumi2-demo.svg?style=flat)](https://npmjs.org/package/dumi2-demo)

A react library developed with dumi

## Usage

TODO

## Options

TODO

## Development

```bash
# install dependencies
$ yarn install

# develop library by docs demo
$ yarn start

# build library source code
$ yarn run build

# build library source code in watch mode
$ yarn run build:watch

# build docs
$ yarn run docs:build

# check your project for potential problems
$ yarn run doctor
```

## LICENSE

MIT
npm package: @smallmultiples/bundle
Description: Bundle javascript with browserify, designed to be reused in various ways in gulp task
Author: Small Multiples
Latest version: 1.2.0

Bundle
======

Factory for a bundle function that can be called in multiple places without setting it up often. Uses browserify but with configuration will swap to using watchify instead.

[csonify]: http://npmjs.com/csonify
[babelify]: http://npmjs.com/babelify

Usage
-----

```javascript
var bundleFactory = require('lib/gulp/bundle')
var bundle = bundleFactory({ error: console.error, filename: 'bundled.js' })
bundle('path/to/entry.js', 'path/to/bundled/folder', { debug: true }, done)
```

Missing a lot of the potential options, see api for all of them.

API
---

#### `makeBundle(options)` ####

Returns the `bundle()` function which you will subsequently call. Takes the following options:

* `start`: The string to log when starting a bundle. Defaults to: `'Bundinling Javascript...'`.
* `time`: The string to log when showing how much time a bundle took to complete. Defaults to: `'Bundled JavaScript'`
* `error`: Callback for the error event from the bundler. Defaults to a no-op.
* `transforms`: Array of transforms to pass into a browserify bundler's transform function. Defaults to `[ 'csonify', 'babelify' ]`.
* `extensions`: Passed into the browserify bundler options. Defaults to `[ '.cson', '.json' ]`
* `excludes`: Array of excludes to pass into a browserify bundler's exclude function.
* `onUpdate`: If using watchify, called when the bundler triggers an update and the re-bundle is finished.
* `filename`: What the bundled file should be called. Defaults to `'app.js'`
* `buildNotifications`: Do you want build notifications or not. Defaults to false.
* `notificationText`: Message in build notifications. Defaults to `'Build is ready'`
* `notificationTitle`: Title of build notifications. Defaults to `'BUILD'`
* `uglify`: Options to pass to uglify.

#### `bundle(entry, dest, params, callback)` ####

Bundles the javascript together. Takes an entry file, a destination folder, a params object and a callback to call when the bundle finishes.

* `entry`: The entry file for browserify.
* `dest`: The folder you want to put the bundled file into.
* `params`: An object containing the various params for the bundle.
    * `params.debug`: Passed to the browserify bundler. Determines sourcemaps or not. Default `false`
    * `params.minify`: Determines if we minify or not. Default `false`.
    * `params.once`: Determines if we use browserify (`true`) or watchify (`false`) and rebundle on changes. Default `false`.
* `callback`: A callback to call when the bundle finishes. When using watchify, only called after the first bundle.
npm package: @smallmultiples/emotion-sandbox
Description: A React emotion plugin for high specificity CSS
Author: David Walsh
Latest version: 2.2.0

# emotion-sandbox

A React emotion plugin for high specificity CSS

## Quick use

Use the component at the top level of your react app. It must be the ancestor of any emotion component.

```
yarn add @smallmultiples/emotion-sandbox
```

```
import { StyleSandbox } from "@smallmultiples/emotion-sandbox";

const App = (
  <StyleSandbox elementId="myEmbed">
    {/* rest of application */}
  </StyleSandbox>
);
```

## What it does

It transforms CSS of the form:

```
.css-MyComponent123 {
  color: red;
  font-size: 16;
}
```

into

```
#myEmbed .css-MyComponent123 {
  color: red;
  font-size: 16;
}
```

It also takes care of the `<div id="myEmbed">` markup.

## Why it's useful

It's handy for embedding React applications inside larger websites. In such cases, default site styles often override low specificity styled components. By increasing the specifity of the output CSS, such issues can be avoided. It obviates the need to resort to dirty hacks like the `!important` operator.

## Advanced use

`StyleSandbox` is a wrapper around emotion's [CacheProvider](https://emotion.sh/docs/cache-provider).

If you need to configure `CacheProvider` separately, here's a more manual setup:

```
import { CacheProvider } from "@emotion/core";
import createCache from "@emotion/cache";
import { createSandboxPlugin } from "@smallmultiples/emotion-sandbox";

const styleCache = createCache({
  stylisPlugins: [
    createSandboxPlugin('#myEmbed'), // must match div id below
    /* more plugins */
  ],
  /* more options */
});

const App = (
  <CacheProvider value={styleCache}>
    <div id="myEmbed">
      {/* rest of application */}
    </div>
  </CacheProvider>
);
```
npm package: @smallmultiples/ensure-file
Description: Ensures a file exists, filling it with default values if it doesn't
Author: Small Multiples
Latest version: 1.0.0

Ensure File
===========

Given some contents, ensure a file with those contents exists. Callback or return with the file's contents.

Usage
-----

```javascript

var ensureFile = require('ensure-file')

ensureFile('path/to/file.md', '# foo', function (err, contents) {
    console.log(contents) // '# foo', or contents of existing file
})
// Synchronous version
var contents = ensureFile.sync('path/to/file.md', '# foo')


var ensureJsonFile = require('ensure-file/json')

ensureFileJson('path/to/file.json', { foo: 'bar' }, function (err, contents) {
    console.log(contents) // { foo: 'bar' } or contents of existing file
})
// Synchronous version
var contents = ensureJsonFile.sync('path/to/file.md', { foo: 'bar' })
```

API
---

### `ensureFile(path, contents, callback)` ###

Looks for a file at `path`. If the file exists, calls `callback` with any error that occurred and the contents of the file. If a file doesn't exist at `path`, it will first create the file with the default `contents` before calling the callback with any error and the default contents.

### `ensureFile.sync(path, contents)` ###

The same as `ensureFile()` but synchronous. 

### `ensureJsonFile(path, contents, callback)` ###

The same as `ensureFile()`, however the contents will be run through JSON.stringify before being written to file, and JSON.parse before being returned.

### `ensureJsonFile.sync(path, contents, callback)` ###

The same as `ensureJsonFile()` but synchronous
npm package: @smallmultiples/gulp-error-logger
Description: Logs to console with gulp-util and notifies the user if they've asked for notifications.
Author: Small Multiples
Latest version: 1.0.0

Gulp Error Logger
=================

Takes an error object and tries to find the best thing to log from it. Optionally, depending on settings at creation, can pop up a system notification.

Usage
-----

```javascript
var errorFactory = require('gulp-error-logger')
var errorHandler = errorFactory()

// etc

foo.on('error', errorHandler)
bar.on('error', errorHandler)
```

API
---

#### `errorFactory(options)` ####

Returns a handler function that takes an error parameter, logging and notifying as necessary.

`options` is an optional object with optional properties:

* `notifications`: Boolean, default `true`, send notifications when logging or not.
* `notificationMessage`: Function that takes an error object and returns the message you want the notification to have.
* `notificationTitle`: Function that takes an error object and returns the title you want the notification to have.
* `notifier`: Function that takes an object with a title and a message, causes a notification to appear on the system. Defaults to [node-notifier](https://npmjs.com/node-notifier).
* `logger`: Function that takes a string and logs it in some way. Defaults to `gutil.log`.
npm package: @smallmultiples/ncalls
Description: Runs a callback only on its nth call
Author: Small Multiples
Latest version: 1.0.0

NCalls
======

Takes a number, and a callback, and returns a function. The callback will only be called on the nth call (the number provided).

Usage
-----

```javascript
var ncalls = require('ncalls')
var callback = function () { 
    console.log('foo') 
}

var wrapped = ncalls(3, callback)

wrapped()
wrapped()
wrapped() // 'foo' logged to console
wrapped()
```

API
---

#### `ncalls(count, callback)` ####

Takes a `count` and a `callback` and returns a function that will only call `callback` the `count` time it is called.

* `count`: The number of times the returned function has to be called before `callback` will be called.
* `callback`: The function you want to call on the `count` wrapping function's call.
npm package: @smallmultiples/string-builder
Description: Builds strings by concatenating arguments and appending to a base.
Author: Small Multiples
Latest version: 1.0.0

String Builder
==============

Convenience function for building strings from a common base

Usage
-----

Build a function that appends strings to the common base and returns it

```javascript
var fn = builder('foo')
fn('bar') // 'foobar'
```

It will join multiple arguments passed in:

```javascript
var fn = builder('foo')
fn('bar', 'baz') // 'foobarbaz'
```

If you pass in an array as an argument it will join the array with the joiner argument (passed into the factory as the second argument, defaults to '') before concating the base and the args together.

```javascript
var fn = builder('foo')
fn(['bar', 'baz']) // 'foobarbaz'

fn = builder('foo', ':')
fn(['bar', 'baz']) // 'foobar:baz'
```

Object arguments will have their `toString` method called before concatenation

```javascript
var fn = builder('foo')
fn({ toString: function () {return 'bar'} }) // 'foobar'
```

Api
---

#### `factory(base='', joiner='')` ####

Factory function that optionally takes a `base` and a `joiner` and returns a function to call to build strings with. `base` and `joiner` should both be a strings, or cast to strings. Returns the builder function. 

`joiner` is used to join any array arguments passed into the builder before concatenation.

#### `builder(args...)` ####

Concatenates arguments together and with the `base` string provided by the factory.

If an arg is an array, it will be joined with the `joiner` provided by the factory before concatenation with the base and other arguments.

If an arg is an object, it will have its toString method called on it before concatenation with the base and other arguments.

License
-------

MIT Licensed. See LICENSE.md for more information.