News for hackers. Stuff that matters.
Re:Show HN: cookies.js, making cookies a delight to work wit... by izolate on Thursday September 08, 2016 @02:51AM (#12450813)
Good work, but I prefer the syntax of cookies-js [1]

Side note, Bower is a dying package manager. You'd get better results if you promoted the npm link over bower.

[1] https://www.npmjs.com/package/cookies-js

Re:Show HN: cookies.js, making cookies a delight to work wit... by franciscop on Thursday September 08, 2016 @02:55AM (#12450830)
Fair enough, I didn't like it and that's the main reason why I continued and published this package. Is it just a preference or do you have any reasoning for liking it?
Re:Show HN: cookies.js, making cookies a delight to work wit... by izolate on Thursday September 08, 2016 @04:43AM (#12451271)
Is preference not a valid reason? :)

Other reason: the syntax is more explicit, and already familiar to anybody who has used Maps [1]

I find your syntax a little confusing. It's not immediately obvious how I would set multiple cookies with different options, for instance.

[1] https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...

Re:Show HN: cookies.js, making cookies a delight to work wit... by franciscop on Thursday September 08, 2016 @04:51AM (#12451314)
It is totally a valid reason, that's what I wanted to say with fair enough (:

I see, you could just call the same function few times with different options (preferred) as cookies(cookie1, opt1); cookies(cookie2, opt2); or concatenate them: cookies(cookie1, opt1)(cookie2, opt2); but this is arguably really strange syntax.

I will add more examples to the readme.md to make it more clear :+1:

Re:Show HN: cookies.js, making cookies a delight to work wit... by Fifer82 on Thursday September 08, 2016 @06:19AM (#12451700)
Unlike izolate, I prefer your API. Great Library!
Re:Show HN: cookies.js, making cookies a delight to work wit... by franciscop on Friday September 09, 2016 @02:56AM (#12460120)
Thank you
Re:Show HN: cookies.js, making cookies a delight to work wit... by berdario on Thursday September 08, 2016 @09:26AM (#12452733)
Bower is definitely not dying, and in fact Npm is totally unsuited for some communities

http://harry.garrood.me/blog/purescript-why-bower/

Re:Show HN: cookies.js, making cookies a delight to work wit... by joshwcomeau on Thursday September 08, 2016 @12:46PM (#12454661)
https://www.google.com/trends/explore?q=bower,npm

"Dying" is a bit strong, but there's no question that NPM is becoming the go-to choice for javascript development across the stack.

Re:Show HN: cookies.js, making cookies a delight to work wit... by zatkin on Thursday September 08, 2016 @12:21PM (#12454425)
TL;DR: dependencies are a difficult problem.

When you use two distinct dependencies that subsequently have the same dependency but separate major releases, you may encounter breakage.

The author simply prefers Bower because of how it handles this problem differently than npm.

Re:Show HN: cookies.js, making cookies a delight to work wit... by kakarot on Thursday September 08, 2016 @03:27AM (#12450957)
Is this something like putting it out of its mercy, removing your open support for bower because you hear it's dying?
Re:Show HN: cookies.js, making cookies a delight to work wit... by tracker1 on Thursday September 08, 2016 @02:13PM (#12455569)
To me it's silly that bower requires npm.. so just use npm. Although you may or may not agree with npm's dependency resolution, I find it more silly to use a tool that requires another tool that does the same job...

I prefer my screwdriver, that I have to open with another screwdriver.

Re:Show HN: cookies.js, making cookies a delight to work wit... by Kiro on Thursday September 08, 2016 @09:48AM (#12452944)
To be honest I tend to avoid packages that have bower support. It just gives me the feeling of legacy. It's unfounded, I know, but that's me.
Re:Show HN: cookies.js, making cookies a delight to work wit... by konradb on Thursday September 08, 2016 @11:54AM (#12454161)
To an old man out of the loop, what gives you a supported, future-looking feeling?
Re:Show HN: cookies.js, making cookies a delight to work wit... by izolate on Friday September 09, 2016 @04:08AM (#12460375)
Precisely that. To in-the-loop JS developers, Bower is old news. To see Bower/Less/jQuery in 2016 conjures up images of out of touch backend developers living in 2011.

There are better alternatives available (NPM/PostCSS/vanilla.js to the above)

Re:Show HN: cookies.js, making cookies a delight to work wit... by franciscop on Friday September 09, 2016 @10:38PM (#12467381)
But bower came after NPM...

Anyway, I didn't really intend this library to be in-the-loop. I just did it because I couldn't find one I liked in 2016. Which is just nuts on itself. so I went all old-school and tried to keep cross-browser support high and make it simple. It took an hour to be done and a couple of them to test and document it (plus another couple of them for small details such as CDN, bugs/patchs/small features).

Re:Show HN: cookies.js, making cookies a delight to work wit... by konradb on Friday September 09, 2016 @06:15AM (#12460813)
jQuery to me has the same connotations but I was surprised by Bower. As an out-of-the-loop sometime JS developer what's respectable these days, npm/gulp/sass, vanilla.js/react/angular2?