Skip to content
This repository has been archived by the owner on Aug 29, 2019. It is now read-only.
/ prismejs Public archive

Presentation and transformation layer for api's complex data output

License

Notifications You must be signed in to change notification settings

thomasbrodusch/prismejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prismejs_logo

PrismeJS — A presentation and transformation layer for complex/dirty API's data output.

  • Author — Thomas Brodusch
  • License — MIT

How to use PrismeJS

1. Grab the lib using your favorite package manager

yarn add prismejs

or

npm install prismejs

Have a look on examples/ or test/for more explanations ! You can also npm run examples to watch PrismeJS in action.

2. Use it in your code like a charm

import prismejs from 'prismejs';
import userModel from 'myPrismeModels/user';

// New instance of PrismeJ
const Prisme = new prismejs();

// Example from an api fetched data.
fetch('http://api.myapp.com/users').then(function(response) {
  // Insert your dirty data, PrismeJS will format it using your pretty userModel !
  return Prisme.format(response.data, userModel); 
})

How to contribute on PrismeJS ?

Steps:

  • Fork this repo
  • Code some new stuff
  • npm run dev to develop
  • npm run test:watch to run tests
  • npm run build to generate a builded version
  • Make a Pull Request on branch develop (we using the git-flow branching structure)
  • Don't forget to implement some tests on test/ folder

About

Presentation and transformation layer for api's complex data output

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published