Comments (2)
No problem, I’m happy to help.
To build the files (which takes the files in the source
folder and outputs them to src
), npm run build
will work, which is equivalent to npm run build:cjs
.
To run the example usage, create an index.js
file in the root of the project, and then copy/paste the sample code into index.js
:
const getSelf = require('./src/getSelf')
getSelf().then(x => console.log(x))
Then you should be able to run node index.js
to execute the getSelf
function.
The process for making new additions are:
- Add new file to
source
folder (say that the new file you want to add is ‘getUsersWithGradeThreshold.js`) - In the
source
folder, there’s anindex.js
file that lists all of the files you want exported tosrc
. There you will add:export { default as getUsersWithGradeThreshold } from './getUsersWithGradeThreshold'
- Run
npm run build
, which will build the project and output your new function intosrc
. - In the
index.js
at the root of the project that you create (this is not theindex.js
that’s in thesource
folder), import your new file fromsrc
like this:const getUsersWithGradeThreshold = require('.src/getUsersWithGradeThreshold')
and test by running the code:node index.js
. - Once you’re happy that it works, create a PR.
Please feel free to make improvements to the README – I really appreciate it!
The entire process is a little cumbersome – the reason for this is because I wanted the package to be compatible with UMD and CJS and at the time this seemed like the best option. It’s copied from how Ramda had its package set up: https://github.com/ramda/ramda
Hope this helps. If you have any questions or need help let me know.
from node-canvas-api.
@KingPin1111 just wanted to follow up to see if I can close this issue now.
from node-canvas-api.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-canvas-api.