romancow / codecat Goto Github PK
View Code? Open in Web Editor NEWA CodeKit/Prepros-style method of concatenating javascript and coffeescript files
License: MIT License
A CodeKit/Prepros-style method of concatenating javascript and coffeescript files
License: MIT License
Create a bin file that can be run on the command line (with options) to concatenate files.
Add the ability to prepend/append javascript in a coffeescript file by embedding it via backticks.
Need to add a .npmignore file before releasing on npm
Entered a little into "callback hell" territory, especially when adding recursive functionality, with callbacks that pass callbacks to callbacks. I'd love to reduce this a bit.
Ideas:
EventEmitter
? Or concat methods return an EventEmitter
? Or even implement CodeCat as a stream?So when including node modules, currently their main file is just concatenated as is. This can be problematic if the package was not designed to be used as is in a browser (which is probably most packages). What we need is a strategy to adapt them. I think the best/easiest method of doing this is having a "node module strategy" option that can be passed in that dictates how the user wants to handle it. Not sure what the option would be named yet (nodeStrategy
? just node
? node_modules
?). The potential values would probably be string keywords with scoped constants for convenience.
The possible options could be something like
Window
)underscore
and camelize
''
or *
? Something that wouldn't be a valid js variable name to begin with) to use as the variable name for node modules not explicitly defined in the map (defaulting to global).node_modules.my_module.exported_function()
The ability to prepend/append a directory of files.
Hi! Good initiative, man!
Can we use it on GULP? (newbiealert)
Thank you!
The ability to add custom "directives" (like prepend or append) and associated code that will modify the resulting file in some way.
Ability to use prepend & append directives inside prepended or appended files.
Should we guard against infinite recurse? (e.g. a file including another file that in turn includes the original) Maybe (at least initially) this will just be up to the user to not do.
Add instructions on installation and how to use.
Add the ability to perpend/append node modules (packages installed via npm, yarn, etc.).
How would you specify that an include is a mode module instead of a file? I guess kind of like require works - looks for it as a relative file first, then as a node module.
Tests need to cover more cases and options
Hello,
I create config file and run with node but it does not concat my file. i have something like this:
var CodeCat = require('codecat');
var indexFile = new CodeCat("/www/proj/src/js/custom.js", {encoding: 'utf8'});
var options = {recursive: true, separator: "\n\n\n"};
indexFile.concatTo('/www/proj/static/assets/js/custom.min.js', options, function(error) {
if (error) console.error(error);
});
what I wrong?
Option to watch files for changes and automatically process them when changed
Add a synchronous version or option for the findConcats
, concat
, and concatTo
methods.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.