# Citeproc-js npm package

**URL:** https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246
**Category:** CSL Development
**Created:** [January 27, 2015, 6:29am UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246 "2015-01-27T06:29:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![michelkraemer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/michelkraemer/32/226_2.png) [@michelkraemer](https://discourse.citationstyles.org/u/michelkraemer)
#### Post date: [January 27, 2015, 6:29am UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/1 "2015-01-27T06:29:04Z")

</div>

Dear list,

I’d like to follow up on this issue:  
[https://bitbucket.org/fbennett/citeproc-js/issue/120/create-npm-package-for-nodejs](https://bitbucket.org/fbennett/citeproc-js/issue/120/create-npm-package-for-nodejs)

In one of my previous projects I needed to run citeproc-js in Node.js. I  
tried citeproc-node but it was a bit too much overhead. I wanted to call  
citeproc-js directly without needing to start a web server. Also  
citeproc-node is not available in the npm registry and even if it was it  
would not fit node’s philosophy of small kernels of functionality.

So, I created a very small npm package containing only citeproc.js and  
csl\_nodejs\_jsdom.js from citeproc-node. It works really well and fits  
perfectly in the nodejs world.

I wonder if it would be worthwile pushing this package to the npm  
registry, so that everyone can use it. I would be able to maintain the  
package and keep it up to date, but of course I understand this is for  
you to decide.

Cheers,  
Michel

---

<div class="post-metadata">

### Author: ![Robert\_Knight](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@Robert\_Knight](https://discourse.citationstyles.org/u/Robert_Knight)
#### Post date: [January 27, 2015, 10:03am UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/2 "2015-01-27T10:03:03Z")

</div>

> I would be able to maintain the package and keep it up to date,  
> but of course I understand this is for you to decide.

Does citeproc have integration with Travis or other CI systems that  
could be used to publish to npm automatically?

---

<div class="post-metadata">

### Author: ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)
#### Post date: [January 27, 2015, 10:11am UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/3 "2015-01-27T10:11:03Z")

</div>

It doesn’t at the moment.

The actual processor test suite for citeproc-js is a cumbersome thing  
that I run offline, but I suppose Travis could be used for the limited  
purpose of pushing a tagged release to npm. I don’t have any  
experience with setting up Travis, though, so if it’s left to me, it  
will probably be awhile before I get around to it …

Frank

---

<div class="post-metadata">

### Author: ![michelkraemer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/michelkraemer/32/226_2.png) [@michelkraemer](https://discourse.citationstyles.org/u/michelkraemer)
#### Post date: [January 27, 2015, 4:28pm UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/4 "2015-01-27T16:28:07Z")

</div>

As far as I know, in order to publish to the npm registry you need to  
have a valid username and a password. Performing this process  
automatically would require you to store the password in the source  
repository or somewhere else. I’m not sure if Travis offers some kind of  
a credentials store to handle such cases, but I doubt they do.

---

<div class="post-metadata">

### Author: ![michelkraemer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/michelkraemer/32/226_2.png) [@michelkraemer](https://discourse.citationstyles.org/u/michelkraemer)
#### Post date: [January 27, 2015, 4:32pm UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/5 "2015-01-27T16:32:11Z")

</div>

Just an additional thought, Frank. If you could describe what these  
’cumbersome’ things are that you need to perform to run the test suite I  
may be able to help you automate it with Travis. What do you think?

Cheers,  
Michel

---

<div class="post-metadata">

### Author: ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)
#### Post date: [January 27, 2015, 4:36pm UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/6 "2015-01-27T16:36:24Z")

</div>

See [http://docs.travis-ci.com/user/deployment/npm/](http://docs.travis-ci.com/user/deployment/npm/)

---

<div class="post-metadata">

### Author: ![michelkraemer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/michelkraemer/32/226_2.png) [@michelkraemer](https://discourse.citationstyles.org/u/michelkraemer)
#### Post date: [January 28, 2015, 6:38am UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/7 "2015-01-28T06:38:07Z")

</div>

Thanks, Ritze. I wasn’t aware about this site. So you can generate an  
API key for the npm registry and this key can be encrypted by Travis.  
That’s great news.

Cheers,  
Michel

---

<div class="post-metadata">

### Author: ![Robert\_Knight](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@Robert\_Knight](https://discourse.citationstyles.org/u/Robert_Knight)
#### Post date: [January 28, 2015, 1:02pm UTC](https://discourse.citationstyles.org/t/citeproc-js-npm-package/1246/8 "2015-01-28T13:02:10Z")

</div>

> So you can generate an  
> API key for the npm registry and this key can be encrypted by Travis.  
> That’s great news.

Yes, indeed you can. I’ve got a project on github which automatically  
publishes the master branch to npm.  
The only part that wasn’t conveniently built-in was bumping the  
version number on commit.  
I wrote a utility that bumps the version number on commit by taking a  
‘base’ version number and using  
the number of commits in master as the patch version in package.json -  
[https://github.com/robertknight/passcards/blob/master/utils/update-manifest-version.js](https://github.com/robertknight/passcards/blob/master/utils/update-manifest-version.js)
