1.5.6 • Published 5 years ago

graph_maker v1.5.6

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Module to create statistics in your sql bdd.

My first module npm :)

How to use it :

Using npm :

$ npm i graph_maker

In your code :

makeAGraph ('new_profil', sqlConf);

new_profil => Give the title for insert in raw in a new sql table.
sqlConf => insert your conf request.

Exemple file set sql:

const mysql = require('mysql');

export const setFile = mysql.createConnection({
  host: 'localhost',
  user: '',
  password: '',
  database: '',
});

Example of the function in the code :

import express from 'express';
import passport from 'passport';
import graphMaker from 'graph_maker';

import { setFile  } from '../../setFile';

const router = express.Router();

/* GET user with id. */
router.get('/:id', passport.authenticate('jwt', { session: false }), (req, res) => {
  setFile.query('SELECT `first_name`,`last_name`, `pseudo`, `email`, `photo_profil` FROM _User WHERE id=? ;', req.params.id, (err, result) => {
    if (err) {
      res.status(500);
    } else {
      res.status(200).json({
        result,
      });
    }
  });
  graphMaker('post', setFile);
});

export default router;

Thank you and enjoy ^^

1.5.6

5 years ago

1.5.5

5 years ago

1.5.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago