Have you ever seen a package or library in which all functionality is contained in a single file? There are heaps of them. Additionally, there are very useful code examples in GitHub gists, Pastebin, and other places. A lot of reusable code that can be pasted directly into your project, but doing that manually can be a hurdle. Pastries command-line tool combines the convenience of package managers with the simplicity of copy-pasting code:
- Automatic installation and updating
- No central repository
- No accounts
- Full control of the code
- Utilization of your project's version control system
Download the appropriate executable file from
releases, rename it to pastries
and put it in a directory that is in your PATH variable.
Adding a dependency.
pastries add --name package_name --uri 'https://example.com/file.js' --path './src/path/to/local_file.js'
pastries add --name package_name --uri 'https://example.com/file.js' --path './src/path/to/local_file.js' --update never
pastries add --name package_name --uri './shared/local/file.js' --path './src/path/to/local_file.js' --update always --local
- --name - the package name. It is used for update and remove commands.
- --uri - the source URL or file path.
- --path - the file path where to put the dependency.
- --local - indicates that the source is a local file.
- --update - specifies when to update the dependency. Possible options are
always
,never
andon_change
. The default ison_change
which means the dependency will be updated if the source and the target files are different.
Updating a dependency.
pastries update
pastries update all
pastries update package_name
Removing a dependency.
pastries remove package_name