1.1.6 • Published 3 years ago

@cloudnouns/kit v1.1.6

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

🌩 @cloudnouns/kit

The best way to build with Nouns and Lil Nouns. ⌐◨-◨

@cloudnouns/kit is a JavaScript library, written in TypeScript, that makes creating Nouns dead simple.

  • 🔥 Create *any* Noun or Lil Noun.
  • 👩🏽‍🔬 Choose all, some, or no traits. Or make Nouns with invisible traits.
  • 🟩 Customize background colors
  • 💝 Compatible with any frontend framework (like React, Vue, and Svelte) or vanilla JS.

Note: Check out the Cloud API for a hosted, URL-based version of this library. Perfect for designers and no-code based workflows. Learn more ↗️.

Quick start

Install with your favorite package manager...

npm install @cloudnouns/kit
# or
yarn add @cloudnouns/kit

... import into your project...

import { NounFactory, LilNounFactory } from '@cloudnouns/kit';

... initialize...

// random Noun
const noun = NounFactory.createRandom();
const lilnoun = LilNounFactory.createRandom();

... and use generously.

<img src={noun.svg} alt="noun" />
<img src={lilnoun.svg} alt="noun" />

Noun Properties

propertytype
backgroundstringbackground color string
bodystringname of body trait
accessorystringname of accessory trait
headstringname of head trait
glassesstringname of glasses trait
seedobject
svgstringbase64-encoded svg string
urlstringurl for a hosted image with same properties

Example

const noun = NounFactory.createFromId(429); // Noun 429

/** example properties
noun.background = '#d5d7e1'
noun.body = 'foggrey'
noun.accessory = 'id'
noun.head = 'paperclip'
noun.glasses = 'smoke'
noun.svg = 'data:image/svg+xml;base64,...'
noun.seed = {
	background: 0,
	body: 8,
	accessory: 59,
	head: 147,
	glasses: 16
};
noun.url = 'https://api.cloudnouns.com/v2/nouns/pfp?seed=0,8,59,147,16'
*/

Usage

Factories

NounFactory

LilNounFactory

Methods

.create()

.createFromId()

.createFromLatest()

.createFromSeed()

.createFromString()

.createRandom()

1.1.1

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.1.6

3 years ago

1.0.7

3 years ago

1.1.5

3 years ago

1.0.6

3 years ago

1.1.4

3 years ago

1.0.5

3 years ago

1.1.3

3 years ago

1.0.4

3 years ago

1.1.2

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

0.1.0

3 years ago