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

Add a public API #4

Closed
jescalan opened this issue May 9, 2013 · 4 comments · Fixed by #5
Closed

Add a public API #4

jescalan opened this issue May 9, 2013 · 4 comments · Fixed by #5

Comments

@jescalan
Copy link
Contributor

jescalan commented May 9, 2013

Would make this much easier to integrate into other node apps. Would be happy to fork and submit a pull request for this if you'd like 😄

@xavi-
Copy link
Owner

xavi- commented May 9, 2013

For sure. What did you have in mind? Currently require("copy-paste") returns an object with the three main functions:

{ copy: [Function],
  paste: [Function],
  noConflict: [Function] }

Let me know if anything should be added.

@jescalan
Copy link
Contributor Author

jescalan commented May 9, 2013

I was thinking perhaps some option to disable the global variable attachment, and a callback function on copy and paste rather than an automatically injected console.log?

@xavi-
Copy link
Owner

xavi- commented May 10, 2013

You should be able to disable the global copy and paste functions by calling noConflict. Originally I created this library to make working in the REPL easier. I liked the idea of simply calling require("copy-paste") and immediately being able to use copy and paste, so I made them global by default

Callbacks for copy and paste are good ideas. I'd happily accept a pull request, but if you don't have the time, no worries. I'll try to add them some time this weekend.

@jescalan
Copy link
Contributor Author

Ah nice, didn't realize what noConflict was, but that's great. Totally understand the reason for attaching them to global in some circumstances and not objected to that at all. I'll get in a PR with those callbacks if I can at some point today : )

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

Successfully merging a pull request may close this issue.

2 participants