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

recessjs

v1.0.10

Published

Eazy Peazy Playground Components for React.js

Downloads

39

Readme

Version 1.0 is Ready! More Features and Official Docs Coming Soon!

Eazy Peazy Playground Components for React.js (Just Plug and Play)

Recess.js is built on top of React-Live, an awesome project by Formidable for building a Playground Component.

The current 1.0 version of Recess.js is ready for use. For simple usage I have provided basic instructions below until the Docs are completed.

If you want to use a different theme go here to see the other choices:

Available Themes

Install Recess.js with npm or yarn:

npm install recessjs

or

yarn install recessjs

Once installed you simply import Recess.js into your React App.

Here is an Example:

import Recess from 'recessjs';
import './App.css';

// Used below to show an example but not required.
import styled from 'styled-components';

/*
  Recess.js is the only thing you need to install.
  You only need to import 3 things (Recess, Your code & Theme).
  (Or only 2 things since a default theme is in place)
  1.) import Recess from 'recessjs';
  2.) import code from './code.js';
  3.) import theme from 'prism-react-renderer/themes/<theme-name>';
  The themes that you can import and use are located at:
  https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes
*/

// A JavaScript file to store the code for Recess.js
import code from './code';

// The chosen theme for Recess.js
// Change "github" to the name of the theme you want.
// Eazy Peazy! Dracula is the default.
import theme from 'prism-react-renderer/themes/github';
import otherTheme from 'prism-react-renderer/themes/dracula';

function App() {
  return (
    <div className="App">
      {/* Works because of default settings */}
      <Recess />
      <p>OR</p>
      {/* Your chosen code to be rendered in Recess.js */}
      <Recess code={code} />
      <p>OR</p>
      {/* Your chosen code and theme */}
      <Recess code={code} theme={theme} />
      <p>OR</p>
      {/* dep is your chosen dependencies like styled-components */}
      {/* Install them within your main app and import. */}
      {/* Then pass them to dep. */}
      {/* To pass multiple dependencies place them in an object. */}
      {/* Like this: dep={{styled, bulma, etc.}}  */}
      <Recess code={code} theme={theme} dep={styled} />
      <p>OR</p>
      {/* filename is set to 'App.js' by default. */}
      {/* The filename is displayed at the top of Recess.js  */}
      {/* onInline is set to true by default. Pass it false if desired. */}
      <Recess
        code={code}
        theme={theme}
        dep={styled}
        filename={"NameOfMyApp.js"}
        onInline={false}
      />
    </div>
  );
}

export default App;

Here is a snapshot of Recess.js without any arguments. Behold in all of it's default goodness:

It is REQUIRED to include the render function at the end of each react app as you can see in the code.js file example below:

const code = `const App = () => {
  return (
    <div>
      <h1>Hello Kaycee!</h1>
    </div>
  );
}

render(<App/>);
`;

export default code;

You could also export an object with multiple code examples for Recess.js like so:

const code = {
  firstExample:
    `const AppOne = () => {
       return (
         <div>
           <h1>Hello Kaycee!</h1>
         </div>
       );
     }

     render(<App/>);`,
  secondExample:
    `const AppTwo = () => {
       return (
         <div>
           <h1>Hello William!</h1>
         </div>
       );
     }

     render(<App/>);`
};

Roadmap:

  • Toolbar option (copy-to-clipboard, reset-code, save, etc.)
  • The rest is Top Secret =)

Cheers

Kaycee Ingram