Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make wordDiff available on import #169

Closed
gdavoianb opened this issue Mar 6, 2017 · 3 comments
Closed

Make wordDiff available on import #169

gdavoianb opened this issue Mar 6, 2017 · 3 comments

Comments

@gdavoianb
Copy link

gdavoianb commented Mar 6, 2017

Is it possible to make internal objects like wordDiff importable and available via jsdiff module? I think it makes sense, for example, because sometimes I want to implement my custom diffs, but don't want to rewrite tokenize completely, instead I want to get new tokens by tweaking the base implementation. So importing only diffWords is not flexible and extendable enough, and actually restricts the usage of the library.

@dawadam
Copy link

dawadam commented Jul 1, 2018

You can use that in the meantime :

var jsdiff = require('diff')

@Niels-NTG
Copy link

I think this issue can be considered as resolved, since you can now import every type of diff function individually.

@ExplodingCabbage
Copy link
Collaborator

With the version of jsdiff on master, you can do

require("diff/lib/diff/word.js").wordDiff

This was broken for a while, but #351 fixed it. (The fix isn't in any release on npm yet, but will be in due course.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants