Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bloql

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bloql

Blog engine powered by React using Relay and GraphQL to interact with data

  • 0.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

bloql

Stories in Ready Stories in Current Priority Stories in Progress

Stable version Dependency Status

Blog engine powered by React using Relay and GraphQL to interact with data.

Usage

  • Install bloql package and a bloql retriever to get files:

    npm install bloql bloql-markdown-file-database --save
    
  • Create a backend to serve blog posts:

    var path = require('path');
    var express = require('express');
    var bloql = require('bloql/middleware/express');
    
    const app = express();
    
    bloql(app, {
      pretty: true,
      postsPath: path.join(__dirname, 'posts'),
      database: require('bloql-markdown-file-database')
    });
    
    ...
    
    app.listen(3000, () => {
      console.log('Server started and listening on port 3000');
    });
    

    (for now only available for express)

  • Now you're all set to use bloql on the client:

    import React, { Component } from 'react';
    import ReactDOM from 'react-dom';
    import { createComponent } from 'bloql/PostList';
    
    class PostList extends Component {
    
      render() {
    
        // Render your post list using all react components you want
        return (
          <ul>
            {this.props.posts.edges.map(edge =>
              <li key={edge.node.meta.slug}>{edge.node.meta.title}</li>
            )}
          </ul>
        );
    
      }
    
    }
    
    // Convert your component into a Bloql element
    PostList = createComponent(PostList);
    
    // You can place your component anywhere in any application and
    // combine it with other React components
    ReactDOM.render(
      <PostList/>,
      document.getElementById('app')
    );
    

Have a look there for minimal and understandable examples: bloql-examples

Keywords

FAQs

Package last updated on 12 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc