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 🙏

© 2024 – Pkg Stats / Ryan Hefner

formatizer

v1.5.1

Published

Format easily your message.

Downloads

55

Readme

Formatizer

:muscle: Peer dependencies

You need these packages to install Formatizer.

  • React

:rocket: Installation

To install formatizer :

  • With Yarn, yarn add formatizer
  • Or, with NPM, npm install formatizer

:sunny: Synopsis

With this module, you can format your text more easily. For example, you can format into bold, italic or ~~strike~~ a message, send a smiley, a code snippet or a blockquote... Let's see API Reference for more details. :smile:

:gear: Options

<Formatizer> just need a children message : the string you want format.

:eyes: Code Example

/*
 * Package Import
 */
import { Formatizer } from 'formatizer';
// Other import...

/*
 * Code
 */
const message = '*test*';

/*
 * Component
 */
const App = () => (
  <div>
    <Formatizer>{message}</Formatizer>
    // Output: In this example, test is formatted in bold
  </div>
);

:eyes: Example

You can also try this example in live :

  • Download this repository.
  • Install packages via yarn or npm install
  • Launch watcher via yarn start or npm start
  • Go http://localhost:3333/
  • Test it ! :tada:

API Reference

  • bold :
const message = '*message*';
<Formatizer>{message}</Formatizer>;
// Output: message in BOLD
  • italic :
const message = '_message_';
<Formatizer>{message}</Formatizer>;
// Output: message in ITALIC
  • ~~strike~~ :
const message = '~message~';
<Formatizer>{message}</Formatizer>;
// Output: message in STRIKE
  • Color #ee1225 :
const message = '#ee1225 or #000';
<Formatizer>{message}</Formatizer>;
// Output: colors red and black
const message = '### Hello ###';
<Formatizer>{message}</Formatizer>;
// Output: A message in spoiler
  • Snippet Code :
const message = '```js const a = "string"```';
// You can use : 'apache', 'apacheconf', 'bash', 'sh', 'zsh', 'css', 'xml', 'html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist', 'ini', 'json', 'javascript', 'js', 'jsx', 'less', 'markdown', 'md', 'mkdown', 'mkd', 'php', 'scss', 'sql', 'stylus', 'styl' or 'twig',
<Formatizer>{message}</Formatizer>;
// Output: Code Snipper like here !
  • Code :
const message = '`const a = "string"`'
<Formatizer>{message}</Formatizer>
// Output: Code
  • Blockquote :

const message = '> Message';
<Formatizer>{message}</Formatizer>;
// Output: message in Blockquote
  • We can format links too.
const message = 'https://github.com/o-clock/formatizer';
<Formatizer>{message}</Formatizer>;
// Output: https://github.com/o-clock/formatizer
const message = '[Formatizer](https://github.com/o-clock/formatizer)';
<Formatizer>{message}</Formatizer>;
// Output: Formatizer (https://github.com/o-clock/formatizer in the href property)
  • Emoji with colons (eg. :sunglasses:, :star:, :heart:, or other...) or with Smiley :-P :
const message = ':star:';
<Formatizer>{message}</Formatizer>;
// Output: An Emoji ⭐️ !
  • Picker :sunglasses: :
import { Picker } from 'formatizer';
// onChange = return data @ emoji
<Picker onChange={data => console.log(data)} />;

Tips :bulb:

  1. If you're using Picker, you need add the css file picker.css. You can find this file in folder example/assets

  2. For a better experience when you use Snippet Code and Code, please install and use font Menlo... You can look at the example folder if you want an example.

:construction: Tests

You can run tests with:

  • yarn test: Execute all tests, one time.

  • yarn test:one: Execute one test,

    • Example :arrow_forward: yarn test:one tests/components/Machin.test.js

:busts_in_silhouette: Contributors

Want to contribute ?

  • All contributions are welcome !
  • Download this repository.
  • Install dependencies.
  • Run yarn start
  • Let's go http://localhost:3333/
  • Let's go edit src folder

This project has adopted a small Husky :dog:.

License

MIT License.