Git Product home page Git Product logo

Comments (5)

ranisalt avatar ranisalt commented on August 17, 2024 1

Yup, that is the major issue. Maintaining a single path has helped keep the library short and simple. It has been requested sporadically in the past #136 #254 #267 and 2 out of 3 times it was lack of information about promises

In the case that it was actually a limitation, I suggested deasync, which ends up being a good solution as you'll likely have to handle other async dependencies in your code. So I consider it a win-win 😉

the fact that exists has been deprecated in favour of existsSync would suggest the opposite

That's not the case though. It has been superseded by stat or access and the removal has more to do with the fact there is a race condition when checking if a file exists prior to operating with it, so it's better to just try the operation and catch the error

from node-argon2.

ranisalt avatar ranisalt commented on August 17, 2024

What's the niche use case you have in mind?

from node-argon2.

euberdeveloper avatar euberdeveloper commented on August 17, 2024

Something like this
https://stackoverflow.com/a/64200074

Also I don't see why someone couldn't be able to choose a synchronous function

from node-argon2.

ranisalt avatar ranisalt commented on August 17, 2024

Also I don't see why someone couldn't be able to choose a synchronous function

It's a matter of maintaining extra code in order to support a scenario that hasn't really happened in the past years. Even the native Node modules now have a promises version (i.e. fs/promises and readline/promises)

You can use deasync if you really want use synchronous calls, though I highly recommend against

from node-argon2.

euberdeveloper avatar euberdeveloper commented on August 17, 2024

I don't see a relation between the promises version of fs and having a synchronous version for this library.

The promises thing has been introduced because otherwise it would have worked with the ugly old-style callbacks and one would have had to create promises to be able to use async/await
Actually the fact that there are sync. versions for most of the functions (such as readdirSync) and the fact that exists has been deprecated in favour of existsSync would suggest the opposite.

Still, I understand if you don't want to have more code to maintain

from node-argon2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.